Exemplo n.º 1
0
 /**
  * Run "down" a migration instance.
  *
  * @param  object  $migration
  * @param  bool    $pretend
  * @return void
  */
 protected function runDown($migration, $pretend)
 {
     $class = $migration->migration;
     // First we will get the file name of the migration so we can resolve out an
     // instance of the migration. Once we get an instance we can either run a
     // pretend execution of the migration or we can run the real migration.
     $instance = $this->resolve($class);
     if ($pretend) {
         return $this->pretendToRun($instance, 'down');
     }
     $instance->down();
     // Once we have successfully run the migration "down" we will remove it from
     // the migration repository so it will be considered to have not been run
     // by the application then will be able to fire by any later operation.
     $this->repository->delete($migration);
     $this->note("<info>Rolled back:</info> {$class}");
 }