コード例 #1
0
ファイル: Migrator.php プロジェクト: hochanh/Bootsoft-Bowling
 /**
  * Run an array of migrations.
  *
  * @param  Symfony\Component\Console\Output\OutputInterface  $output
  * @param  array   $migrations
  * @param  string  $package
  * @param  bool    $pretend
  * @return void
  */
 public function runMigrationList(OutputInterface $output, $migrations, $package, $pretend = false)
 {
     // First we will just make sure that there are any migrations to run. If there
     // aren't, we will just make a note of it to the developer so they're aware
     // that all of the migrations have been run against this database system.
     if (count($migrations) == 0) {
         $output->writeln('<info>Nothing to migrate.</info>');
         return;
     }
     $batch = $this->repository->getNextBatchNumber();
     // Once we have the array of migrations, we will spin through them and run the
     // migrations "up" so the changes are made to the databases. We'll then log
     // that the migration was run so we don't repeat it next time we execute.
     foreach ($migrations as $file) {
         $this->runUp($output, $package, $file, $batch, $pretend);
     }
 }