Migrated issue, originally created by Jack Zhou (@univerio)
It seems by default alembic runs a sequence of migrations in a single transaction. However, this causes problems in e.g. PostgreSQL where certain queries cannot run together in the same transaction and fail with an error like:
#!
sqlalchemy.exc.OperationalError: (OperationalError) cannot ALTER TABLE "some_table" because it has pending trigger events
Because of this, upgrading a database from None to head all at once might fail while upgrading one None to <intermediate_revision> and then from <intermediate_revision> to head would succeed.
It would be helpful to have the option of running each migration in its own transaction (which means alembic would stop at the first failed migration without rolling back all the previous migrations).
Attachments: 201.patch
Migrated issue, originally created by Jack Zhou (@univerio)
It seems by default alembic runs a sequence of migrations in a single transaction. However, this causes problems in e.g. PostgreSQL where certain queries cannot run together in the same transaction and fail with an error like:
Because of this, upgrading a database from
Nonetoheadall at once might fail while upgrading oneNoneto<intermediate_revision>and then from<intermediate_revision>toheadwould succeed.It would be helpful to have the option of running each migration in its own transaction (which means alembic would stop at the first failed migration without rolling back all the previous migrations).
Attachments: 201.patch