コード例 #1
0
 public function up()
 {
     require $this->fileInfo->__toString();
     $migrationName = $this->getName();
     $this->container->create($migrationName)->up();
     $this->adapter->initialize();
     $this->adapter->up($this->getId(), file_get_contents($this->fileInfo));
 }
コード例 #2
0
ファイル: MigrateManager.php プロジェクト: wandu/framework
 /**
  * @return array|\Wandu\Database\Migrator\MigrationContainer[]
  */
 public function migrate()
 {
     $migratedMigrations = [];
     $migrations = $this->getMigrations();
     foreach ($migrations as $migration) {
         if (!$this->adapter->version($migration->getId())) {
             $migration->up();
             $migratedMigrations[] = $migration;
         }
     }
     return $migratedMigrations;
 }