start migration admin action

This commit is contained in:
Baptiste Lemoine 2020-06-11 16:21:44 +02:00
parent cce2319a10
commit 31dec906ea
1 changed files with 29 additions and 0 deletions

View File

@ -68,4 +68,33 @@ class AdminController extends FramadateController {
200 );
}
/**
* Delete all expired polls and their children
* @Get(
* path = "/polls/migrate",
* name = "_migrate_framadate",
* )
* token is set up in the main env file
*/
public
function runMigrationFromOldFramadate(
string $token
) {
// TODO
// fetch old polls and store their properties in new poll objects
$foundPolls = [];
$database_name = 'symfony';
$em = $this->getDoctrine()->getManager();
$emPoll = $this->getDoctrine()->getRepository( Poll::class );
return $this->json( [
'message' => 'migration done for: ' . count( $foundPolls ). ' - this feature is not ready to work YET.',
'data' => [
'count' => count( $foundPolls ),
],
],
200 );
}
}