namespace OC\DB;
use Doctrine\DBAL\Exception;
+use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\AbstractAsset;
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Index;
$schemaDiff = $this->getDiff($targetSchema, $connection);
- $connection->beginTransaction();
+ if (!$connection->getDatabasePlatform() instanceof MySQLPlatform) {
+ $connection->beginTransaction();
+ }
$sqls = $schemaDiff->toSql($connection->getDatabasePlatform());
$step = 0;
foreach ($sqls as $sql) {
$this->emit($sql, $step++, count($sqls));
$connection->query($sql);
}
- $connection->commit();
+ if (!$connection->getDatabasePlatform() instanceof MySQLPlatform) {
+ $connection->commit();
+ }
}
/**