Skip to content

Commit

Permalink
do not use by default transactional DDL when the database engine does…
Browse files Browse the repository at this point in the history
… not support them
  • Loading branch information
goetas committed Apr 25, 2021
1 parent 1f34c29 commit 049640d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Doctrine/Migrations/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\Exception\AbortMigration;
Expand Down Expand Up @@ -50,15 +52,15 @@ public function __construct(Connection $connection, LoggerInterface $logger)
/**
* Indicates the transactional mode of this migration.
*
* If this function returns true (default) the migration will be executed
* If this function returns true (default when the underlying database supports transactional DDL) the migration will be executed
* in one transaction, otherwise non-transactional state will be used to
* execute each of the migration SQLs.
*
* Extending class should override this function to alter the return value.
*/
public function isTransactional(): bool
{
return true;
return ! ($this->platform instanceof MySqlPlatform || $this->platform instanceof OraclePlatform);
}

public function getDescription(): string
Expand Down

0 comments on commit 049640d

Please sign in to comment.