@@ -87,9 +87,9 @@ private function publishConfig(): void
8787 $ this ->setupHelper ();
8888 $ this ->setupRoutes ();
8989
90- $ this ->runMigrations ();
91-
9290 $ this ->setSecurityCSRF ();
91+
92+ $ this ->runMigrations ();
9393 }
9494
9595 /**
@@ -260,18 +260,6 @@ private function setupRoutes(): void
260260 $ this ->add ($ file , $ check , $ pattern , $ replace );
261261 }
262262
263- private function runMigrations (): void
264- {
265- if (
266- $ this ->cliPrompt (' Run `spark migrate --all` now? ' , ['y ' , 'n ' ]) === 'n '
267- ) {
268- return ;
269- }
270-
271- $ command = new Migrate (Services::logger (), Services::commands ());
272- $ command ->run (['all ' => null ]);
273- }
274-
275263 /**
276264 * @see https://github.com/codeigniter4/shield/security/advisories/GHSA-5hm8-vh6r-2cjq
277265 */
@@ -302,12 +290,24 @@ private function setSecurityCSRF(): void
302290 }
303291
304292 if (write_file ($ path , $ output )) {
305- CLI ::write (CLI ::color (' Update : ' , 'green ' ) . "We have updated file ' {$ cleanPath }' for security reasons. " );
293+ CLI ::write (CLI ::color (' Updated : ' , 'green ' ) . "We have updated file ' {$ cleanPath }' for security reasons. " );
306294 } else {
307295 CLI ::error (" Error updating file ' {$ cleanPath }'. " );
308296 }
309297 }
310298
299+ private function runMigrations (): void
300+ {
301+ if (
302+ $ this ->cliPrompt (' Run `spark migrate --all` now? ' , ['y ' , 'n ' ]) === 'n '
303+ ) {
304+ return ;
305+ }
306+
307+ $ command = new Migrate (Services::logger (), Services::commands ());
308+ $ command ->run (['all ' => null ]);
309+ }
310+
311311 /**
312312 * This method is for testing.
313313 */
0 commit comments