src/Console/DownCommand.php 1 location
|
@@ 14-31 (lines=18) @@
|
| 11 |
|
use Symfony\Component\Console\Input\InputInterface; |
| 12 |
|
use Symfony\Component\Console\Output\OutputInterface; |
| 13 |
|
|
| 14 |
|
class DownCommand extends ConsoleCommand |
| 15 |
|
{ |
| 16 |
|
protected function configure() |
| 17 |
|
{ |
| 18 |
|
parent::configure(); |
| 19 |
|
$this |
| 20 |
|
->setName('down') |
| 21 |
|
->setDescription('Migrate down the database version.'); |
| 22 |
|
|
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
protected function execute(InputInterface $input, OutputInterface $output) |
| 26 |
|
{ |
| 27 |
|
parent::execute($input, $output); |
| 28 |
|
$this->migration->down($this->upTo); |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
} |
| 32 |
|
|
src/Console/UpCommand.php 1 location
|
@@ 14-30 (lines=17) @@
|
| 11 |
|
use Symfony\Component\Console\Input\InputInterface; |
| 12 |
|
use Symfony\Component\Console\Output\OutputInterface; |
| 13 |
|
|
| 14 |
|
class UpCommand extends ConsoleCommand |
| 15 |
|
{ |
| 16 |
|
protected function configure() |
| 17 |
|
{ |
| 18 |
|
parent::configure(); |
| 19 |
|
$this |
| 20 |
|
->setName('up') |
| 21 |
|
->setDescription('Migrate Up the database version'); |
| 22 |
|
|
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
protected function execute(InputInterface $input, OutputInterface $output) |
| 26 |
|
{ |
| 27 |
|
parent::execute($input, $output); |
| 28 |
|
$this->migration->up($this->upTo); |
| 29 |
|
} |
| 30 |
|
} |
| 31 |
|
|
src/Console/DatabaseVersionCommand.php 1 location
|
@@ 14-30 (lines=17) @@
|
| 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 |
|
} |
| 31 |
|
|