Version should be written after every migration #112
Migrated issue, originally created by kaukas (@kaukas)
Consider two migrations: A and B; A succeeds while B fails due to some error. After database migration you get A fully applied and B partially applied or not applied at all.
However, the migrations table remains empty. Once I fix B I should be able to rerun just B but A is executed as well.
The text was updated successfully, but these errors were encountered:
Michael Bayer (@zzzeek) wrote:
this is because your database doesn't support transactional ddl.
alembic does do this for when transactional DDL isn't on, on line 212 of migrations.py:
so then I checked what env.py does, by default it's this:
so that's the problem right? wrong, begin_transaction() also checks transactional DDL, and doesn't actually run a transaction:
so I am not seeing how your error is occurring, unless your tranasctional_ddl flag is incorrectly set. The version table is written after each migration and the connection is in autocommit mode when transactional_ddl is false. I need a lot more detail here including database in use as well as some log output.