diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 0fc1b75..dead6af 100755 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -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 ); + } }