-
-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Currently, the CockroachDB translator generates statements that are executed in transactional isolation by appending COMMIT TRANSACTION;BEGIN TRANSACTION;
introduced by this commit: da6a949
The idea behind this is simple. CRDB does not support mixing SCHEMA DDL and non-DDL in a single transaction. The idea of the approach is to run each statement in its own transaction.
The problem is though, if any of the transaction fails, the rollback mechanism will not work. Leaving the database in a state where parts of the transactions have completed while others have not. The way the pop migrator works (keeping track of which files have been applied) means that we can end up in a state where migrations can no longer be applied and manual intervention is required.
We will probably work around this ourselves using the approach I outlined in #92 and splitting every SQL instruction into its own file, to ensure that we never end up with a broken state.