| Conditions | 3 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 19 | { |
||
| 20 | // drop cached schema |
||
| 21 | $this->cycleOrmHelper->dropCurrentSchemaCache(); |
||
| 22 | |||
| 23 | $this->findMigrations($output); |
||
| 24 | |||
| 25 | try { |
||
| 26 | $migration = $this->migrator->rollback(); |
||
| 27 | if (!$migration instanceof MigrationInterface) { |
||
| 28 | throw new \Exception('Migration not found'); |
||
| 29 | } |
||
| 30 | |||
| 31 | $state = $migration->getState(); |
||
| 32 | $status = $state->getStatus(); |
||
| 33 | $output->writeln('<fg=cyan>' . $state->getName() . '</>: ' . (static::$migrationStatus[$status] ?? $status)); |
||
| 34 | } catch (\Throwable $e) { |
||
| 35 | $output->writeln([ |
||
| 36 | '<fg=red>Error!</>', |
||
| 37 | $e->getMessage(), |
||
| 38 | ]); |
||
| 39 | return; |
||
| 40 | } |
||
| 43 |