| Conditions | 4 |
| Paths | 19 |
| Total Lines | 24 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 28 | { |
||
| 29 | try { |
||
| 30 | parent::execute($input, $output); |
||
| 31 | |||
| 32 | $action = 'Database is already versioned. '; |
||
| 33 | try { |
||
| 34 | $this->migration->getCurrentVersion(); |
||
| 35 | } catch (DatabaseNotVersionedException $ex) { |
||
| 36 | $action = 'Created the version table'; |
||
| 37 | $this->migration->createVersion(); |
||
| 38 | } catch (OldVersionSchemaException $ex) { |
||
| 39 | $action = 'Updated the version table'; |
||
| 40 | $this->migration->updateTableVersion(); |
||
| 41 | } |
||
| 42 | |||
| 43 | $version = $this->migration->getCurrentVersion(); |
||
| 44 | $output->writeln($action); |
||
| 45 | $output->writeln('current version: ' . $version['version']); |
||
| 46 | $output->writeln('current status.: ' . $version['status']); |
||
| 47 | } catch (\Exception $ex) { |
||
| 48 | $this->handleError($ex, $output); |
||
| 49 | } |
||
| 50 | } |
||
| 51 | } |
||
| 52 |