Skip to content

Run each migration in a separate transaction #1126

Discussion options

You must be logged in to vote

Is there a way to run each migration in a seperate transaction? I am using Postgres, and I am trying to set up something like this with auto-migrations.

absolutely, you can set transaction_per_migration for this.

A couple things. This feels a bit hacky, and I am just wondering if there is a better way to do it. Also, the mako template doesn't seem to add extra whitespace inside of the context manager.

Right...indentation is not part of what it renders, if you wanted to do that you'd break it into separate methods.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@pythonweb2
Comment options

Comment options

You must be logged in to vote
1 reply
@pythonweb2
Comment options

Answer selected by pythonweb2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants