Transactional Migration Rollback Safety Configuration in CodeIgniter 4
0 reputation · 28 Jun 2025, 23:08 UTC
Transactional Migration Rollback in CodeIgniter 4
The goal is to guarantee that a failed migration leaves the database unchanged, even when the migration contains schema‑altering statements such as CREATE TABLE or ALTER TABLE.
In MySQL, DDL commands cause an implicit commit that breaks the transaction wrapper CodeIgniter applies by default, so a rollback may not undo those changes.
It is unclear whether the framework provides a configuration option to disable automatic commits for DDL within migrations or to wrap such statements in savepoints on DBMS that support them.
Is there a setting to turn off implicit commits for DDL inside migration transactions?
Can developers enable savepoint‑based wrapping for transactional DDL on MySQL or other engines?
Does CodeIgniter expose a driver‑specific flag to make rollback safe regardless of the underlying database’s DDL behavior?