@@ -26,22 +26,26 @@ protected function configure()
2626
2727 protected function execute (InputInterface $ input , OutputInterface $ output )
2828 {
29- parent ::execute ($ input , $ output );
30-
31- $ action = 'Database is already versioned. ' ;
3229 try {
33- $ this ->migration ->getCurrentVersion ();
34- } catch (DatabaseNotVersionedException $ ex ) {
35- $ action = 'Created the version table ' ;
36- $ this ->migration ->createVersion ();
37- } catch (OldVersionSchemaException $ ex ) {
38- $ action = 'Updated the version table ' ;
39- $ this ->migration ->updateTableVersion ();
40- }
30+ parent ::execute ($ input , $ output );
4131
42- $ version = $ this ->migration ->getCurrentVersion ();
43- $ output ->writeln ($ action );
44- $ output ->writeln ('current version: ' . $ version ['version ' ]);
45- $ output ->writeln ('current status.: ' . $ version ['status ' ]);
32+ $ action = 'Database is already versioned. ' ;
33+ try {
34+ $ this ->migration ->getCurrentVersion ();
35+ } catch (DatabaseNotVersionedException $ ex ) {
36+ $ action = 'Created the version table ' ;
37+ $ this ->migration ->createVersion ();
38+ } catch (OldVersionSchemaException $ ex ) {
39+ $ action = 'Updated the version table ' ;
40+ $ this ->migration ->updateTableVersion ();
41+ }
42+
43+ $ version = $ this ->migration ->getCurrentVersion ();
44+ $ output ->writeln ($ action );
45+ $ output ->writeln ('current version: ' . $ version ['version ' ]);
46+ $ output ->writeln ('current status.: ' . $ version ['status ' ]);
47+ } catch (\Exception $ ex ) {
48+ $ this ->handleError ($ ex , $ output );
49+ }
4650 }
4751}
0 commit comments