예제 #1
0
파일: Setup.php 프로젝트: itkg/core
 /**
  * Create a migration from SQL script & rollback script
  *
  * @param $script
  * @param $rollbackScript
  * @throws \InvalidArgumentException
  *
  * @return $this
  */
 public function createMigration($script, $rollbackScript)
 {
     $this->releaseChecker->checkScript($script, $rollbackScript);
     if ($this->rollbackedFirst) {
         /* When rollback is needed first we invert script & rollback script */
         list($rollbackScript, $script) = array($script, $rollbackScript);
     }
     $this->migrations[] = $this->migrationFactory->createMigration($this->loader->load($script)->getQueries(), $this->loader->load($rollbackScript)->getQueries());
     return $this;
 }
예제 #2
0
파일: FactoryTest.php 프로젝트: itkg/core
 public function testCreateMigration()
 {
     $factory = new Factory();
     $this->assertInstanceOf('Itkg\\Core\\Command\\DatabaseUpdate\\Migration', $factory->createMigration(array(), array()));
 }