File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ require_once($autoload);
1313
1414use Symfony \Component \Console \Application ;
1515
16- $ application = new Application ('Migrate Script by JG ' , '1.1.0 ' );
16+ $ application = new Application ('Migrate Script by JG ' , '1.1.1 ' );
1717$ application ->add (new \ByJG \DbMigration \Console \ResetCommand ());
1818$ application ->add (new \ByJG \DbMigration \Console \UpCommand ());
1919$ application ->add (new \ByJG \DbMigration \Console \DownCommand ());
2020$ application ->add (new \ByJG \DbMigration \Console \CreateCommand ());
21+ $ application ->add (new \ByJG \DbMigration \Console \DatabaseVersionCommand ());
2122$ application ->run ();
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Created by PhpStorm.
4+ * User: jg
5+ * Date: 17/06/16
6+ * Time: 21:52
7+ */
8+
9+ namespace ByJG \DbMigration \Console ;
10+
11+ use Symfony \Component \Console \Input \InputInterface ;
12+ use Symfony \Component \Console \Output \OutputInterface ;
13+
14+ class DatabaseVersionCommand extends ConsoleCommand
15+ {
16+ protected function configure ()
17+ {
18+ parent ::configure ();
19+ $ this
20+ ->setName ('version ' )
21+ ->setDescription ('Get the current database version ' );
22+
23+ }
24+
25+ protected function execute (InputInterface $ input , OutputInterface $ output )
26+ {
27+ parent ::execute ($ input , $ output );
28+ $ output ->writeln ('version: ' . $ this ->migration ->getCurrentVersion ());
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments