Does Doctrine DBAL support transaction‑wrapped ALTER TABLE for atomic rollback in MySQL?
0 reputation · 09 Mar 2021, 17:41 UTC
Goal: ensure that a rollback can safely revert a schema change performed by Doctrine DBAL's ALTER TABLE.
Constraint: MySQL and MariaDB execute DDL outside transaction boundaries by default, Schema Manager's dropColumn and addColumn perform immediate DDL without wrapping, and MySQL 5.x auto‑commits each statement while 8.0+ may allow atomic DDL; Doctrine's TransactionGuard can defer rollbacks but cannot undo completed DDL statements.
Question: Can Doctrine DBAL wrap ALTER TABLE in a transaction that can be rolled back on failure? Question: Which DBAL version supports transaction‑wrapped DDL for MySQL 8.0? Question: Can the Schema Manager be configured to defer DDL execution until commit?