| @@ 13-42 (lines=30) @@ | ||
| 10 | /** |
|
| 11 | * MigrateCommand |
|
| 12 | */ |
|
| 13 | class MigrateUpCommand extends Command |
|
| 14 | { |
|
| 15 | use DbHelper; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Configuration of command |
|
| 19 | */ |
|
| 20 | protected function configure() |
|
| 21 | { |
|
| 22 | $this |
|
| 23 | ->setName('migrate:up') |
|
| 24 | ->setDescription('Command for run migration') |
|
| 25 | ; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Execute method of command |
|
| 30 | * |
|
| 31 | * @param InputInterface $input |
|
| 32 | * @param OutputInterface $output |
|
| 33 | * |
|
| 34 | * @return void |
|
| 35 | */ |
|
| 36 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 37 | { |
|
| 38 | $this->runAction(MIGRATIONS_PATH, $output, $this->migrationsTable, 'up'); |
|
| 39 | ||
| 40 | return; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 13-42 (lines=30) @@ | ||
| 10 | /** |
|
| 11 | * SeedCommand |
|
| 12 | */ |
|
| 13 | class RunSeedCommand extends Command |
|
| 14 | { |
|
| 15 | use DbHelper; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Configuration of command |
|
| 19 | */ |
|
| 20 | protected function configure() |
|
| 21 | { |
|
| 22 | $this |
|
| 23 | ->setName('run:seed') |
|
| 24 | ->setDescription('Command for run seed') |
|
| 25 | ; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Execute method of command |
|
| 30 | * |
|
| 31 | * @param InputInterface $input |
|
| 32 | * @param OutputInterface $output |
|
| 33 | * |
|
| 34 | * @return void |
|
| 35 | */ |
|
| 36 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 37 | { |
|
| 38 | $this->runAction(SEEDS_PATH, $output, $this->seedsTable, 'run'); |
|
| 39 | ||
| 40 | return; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||