Пример #1
0
 /**
  * Run 'up' a migration.
  *
  * @param  MigrationInterface $migration
  * @param  int       $batch
  * @return void
  */
 public function runUp(Adapter\MigrationInterface $migration, $batch)
 {
     try {
         $migration->up();
         $this->_note('<comment>- Ran up ' . $migration->getReference() . '</comment>');
     } catch (Exception $e) {
         $this->_note('<error>- Failed to run up ' . $migration->getReference() . '</error>');
         $this->_note('<error>	with message: "' . $e->getMessage() . '"</error>');
         return;
     }
     $this->_creator->log($migration, $batch);
 }
Пример #2
0
 /**
  * Run 'down' a migration.
  *
  * @param  MigrationInterface $migration
  * @return void
  */
 protected function _runDown(MigrationInterface $migration)
 {
     try {
         $migration->down();
         $this->_note('<comment>- Ran down ' . $migration->getReference() . '</comment>');
     } catch (Exception $e) {
         $this->_note('<error>- Failed to run down ' . $migration->getReference() . ' with message ' . $e->getMessage() . '</error>');
         return;
     }
     $this->_deletor->delete($migration);
 }