Exemplo n.º 1
0
Arquivo: Runner.php Projeto: itkg/core
 /**
  * Play Script queries
  *
  * @param bool $executeQueries
  * @throws Migration\Exception
  * @throws \Exception
  * @return void
  */
 private function playQueries($executeQueries = false)
 {
     foreach ($this->migration->getQueries() as $idx => $query) {
         try {
             $this->runQuery($query, $executeQueries);
         } catch (\Exception $e) {
             // Only throw if more than one query is played
             if ($idx >= 1) {
                 throw new Exception($e->getMessage());
             }
             throw $e;
         }
     }
 }
Exemplo n.º 2
0
 public function testQueries()
 {
     $queries = array('QUERY 1', 'QUERY 2');
     $rollbackQueries = array('ROLLBACK QUERY 1', 'ROLLBACK QUERY 2');
     $migration = new Migration($queries, $rollbackQueries);
     $this->assertEquals($queries, $migration->getQueries());
     $this->assertEquals($rollbackQueries, $migration->getRollbackQueries());
 }