diff --git a/scripts/migrate b/scripts/migrate index 5e5b12d..371836e 100755 --- a/scripts/migrate +++ b/scripts/migrate @@ -13,9 +13,10 @@ require_once($autoload); use Symfony\Component\Console\Application; -$application = new Application('Migrate Script by JG', '1.1.0'); +$application = new Application('Migrate Script by JG', '1.1.1'); $application->add(new \ByJG\DbMigration\Console\ResetCommand()); $application->add(new \ByJG\DbMigration\Console\UpCommand()); $application->add(new \ByJG\DbMigration\Console\DownCommand()); $application->add(new \ByJG\DbMigration\Console\CreateCommand()); +$application->add(new \ByJG\DbMigration\Console\DatabaseVersionCommand()); $application->run(); diff --git a/src/Console/DatabaseVersionCommand.php b/src/Console/DatabaseVersionCommand.php new file mode 100644 index 0000000..a1d8830 --- /dev/null +++ b/src/Console/DatabaseVersionCommand.php @@ -0,0 +1,30 @@ +setName('version') + ->setDescription('Get the current database version'); + + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + parent::execute($input, $output); + $output->writeln('version: ' . $this->migration->getCurrentVersion()); + } +}