Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
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.