Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function rollback()
 {
     return $this->driver->rollbackTransaction();
 }
Пример #2
0
 /**
  * Perform set of atomic operations required to update table schema.
  *
  * @throws SchemaException
  * @throws \Exception
  */
 protected function updateSchema()
 {
     if ($this->primaryKeys != $this->dbPrimaryKeys) {
         throw new SchemaException("Primary keys can not be changed for already exists table.");
     }
     $this->driver->beginTransaction();
     try {
         $this->updateColumns();
         $this->updateIndexes();
         $this->updateForeigns();
     } catch (\Exception $exception) {
         $this->driver->rollbackTransaction();
         throw $exception;
     }
     $this->driver->commitTransaction();
 }