| @@ 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 | ||
| @@ 14-32 (lines=19) @@ | ||
| 11 | use Symfony\Component\Console\Input\InputInterface; |
|
| 12 | use Symfony\Component\Console\Output\OutputInterface; |
|
| 13 | ||
| 14 | class ResetCommand extends ConsoleCommand |
|
| 15 | { |
|
| 16 | protected function configure() |
|
| 17 | { |
|
| 18 | parent::configure(); |
|
| 19 | $this |
|
| 20 | ->setName('reset') |
|
| 21 | ->setDescription('Create a fresh new database'); |
|
| 22 | ||
| 23 | } |
|
| 24 | ||
| 25 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 26 | { |
|
| 27 | parent::execute($input, $output); |
|
| 28 | $this->migration->prepareEnvironment(); |
|
| 29 | $this->migration->reset($this->upTo); |
|
| 30 | } |
|
| 31 | ||
| 32 | } |
|
| 33 | ||
| @@ 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 | ||