Пример #1
0
 private function dbRollback()
 {
     $queriesExecuted = count($this->executedQueries);
     $this->adapter->rollback();
     $this->executedQueries[] = '::rollback';
     // own rollback for create table
     for ($i = $queriesExecuted; $i > 0; $i--) {
         $queryIndex = $i - 1;
         if (!($this->queries[$queryIndex] && isset($this->tables[$queryIndex]))) {
             continue;
         }
         $queryBuilder = $this->adapter->getQueryBuilder();
         $queries = $queryBuilder->dropTable($this->tables[$queryIndex]);
         foreach ($queries as $query) {
             $this->adapter->execute($query);
             $this->executedQueries[] = $query instanceof PDOStatement ? $query->queryString : $query;
         }
     }
 }
Пример #2
0
 /**
  * removes migration from log table
  * @param AbstractMigration $migration
  */
 public function removeExecution(AbstractMigration $migration)
 {
     $this->adapter->delete($this->config->getLogTableName(), $this->createData($migration));
 }