From 5f085e78d7da774b31fcf3f701be9ea982c4eb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 14 Jan 2021 13:48:50 +0100 Subject: [PATCH] Expose support for transactional DDL or lack thereof Clients may need that information, notably in the context of SQL migrations. --- src/Platforms/AbstractPlatform.php | 8 ++++++++ src/Platforms/MySQLPlatform.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index 042fae29ee4..b5efed0da40 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -3118,6 +3118,14 @@ public function supportsTransactions() return true; } + /** + * Whether it is safe to wrap DDL statements in transactions + */ + public function supportsTransactionalDDL(): bool + { + return true; + } + /** * Whether the platform supports savepoints. * diff --git a/src/Platforms/MySQLPlatform.php b/src/Platforms/MySQLPlatform.php index d9607c3ef71..3ee8ac442b1 100644 --- a/src/Platforms/MySQLPlatform.php +++ b/src/Platforms/MySQLPlatform.php @@ -337,6 +337,14 @@ public function supportsColumnCollation() return true; } + /** + * @see https://dev.mysql.com/doc/internals/en/transactions-current-situation.html + */ + public function supportsTransactionalDDL(): bool + { + return false; + } + /** * {@inheritDoc} */