diff --git a/doc/manual/upgrading.rst b/doc/manual/upgrading.rst index 912e688589..16aeb9c35a 100644 --- a/doc/manual/upgrading.rst +++ b/doc/manual/upgrading.rst @@ -17,9 +17,6 @@ transferring the configuration settings from the old version. After upgrading the files, you can run ``dj_setup_database upgrade`` to migrate the database. -If you have any active contests, we recommend to run "Refresh -scoreboard cache" from the DOMjudge web interface after the upgrade. - Upgrading from pre-7.0 versions ------------------------------- The upgrade procedure described above works from DOMjudge 7.0 diff --git a/sql/dj_setup_database.in b/sql/dj_setup_database.in index 8095fb706c..fc803939c3 100755 --- a/sql/dj_setup_database.in +++ b/sql/dj_setup_database.in @@ -363,6 +363,8 @@ upgrade) symfony_console doctrine:migrations:migrate -n DBUSER=$domjudge_DBUSER PASSWD=$domjudge_PASSWD symfony_console domjudge:load-default-data + + symfony_console domjudge:refresh-cache verbose "DOMjudge database upgrade completed." ;; diff --git a/webapp/src/Command/RefreshCacheCommand.php b/webapp/src/Command/RefreshCacheCommand.php new file mode 100644 index 0000000000..f93c73024e --- /dev/null +++ b/webapp/src/Command/RefreshCacheCommand.php @@ -0,0 +1,39 @@ +em->getRepository(Contest::class)->findAll(); + foreach ($contests as $contest) { + $this->scoreboardService->refreshCache($contest); + $style->success("Refreshed cache for contest {$contest->getName()}."); + } + + return Command::SUCCESS; + } +}