示例#1
0
文件: Migrator.php 项目: Luceos/core
 /**
  * Rolls all of the currently applied migrations back.
  *
  * @param  string    $path
  * @param  Extension $extension
  * @return int
  */
 public function reset($path, Extension $extension = null)
 {
     $this->notes = [];
     $migrations = array_reverse($this->repository->getRan($extension->getId()));
     $count = count($migrations);
     if ($count === 0) {
         $this->note('<info>Nothing to rollback.</info>');
     } else {
         foreach ($migrations as $migration) {
             $this->runDown($path, $migration, $extension);
         }
     }
     return $count;
 }