Example #1
0
 /**
  * Run an array of migrations.
  *
  * @param  array $migrations
  * @param  bool  $pretend
  *
  * @return void
  */
 public function runMigrationList($migrations, $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) {
         $this->note("<info>Nothing to migrate: {$this->namespace}</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($file, $batch, $pretend);
     }
 }