Merge pull request #9809 from owncloud/check-transaction-before-commit-migration-master
only commit in case a transaction is active
This commit is contained in:
commit
fb0416884f
|
@ -110,7 +110,9 @@ class Migrator {
|
||||||
$this->dropTable($tmpName);
|
$this->dropTable($tmpName);
|
||||||
} catch (DBALException $e) {
|
} catch (DBALException $e) {
|
||||||
// pgsql needs to commit it's failed transaction before doing anything else
|
// pgsql needs to commit it's failed transaction before doing anything else
|
||||||
|
if ($this->connection->isTransactionActive()) {
|
||||||
$this->connection->commit();
|
$this->connection->commit();
|
||||||
|
}
|
||||||
$this->dropTable($tmpName);
|
$this->dropTable($tmpName);
|
||||||
throw new MigrationException($table->getName(), $e->getMessage());
|
throw new MigrationException($table->getName(), $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue