Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change migrations to be transactional #44

Merged
merged 1 commit into from
Apr 7, 2012

Conversation

dcramer
Copy link
Contributor

@dcramer dcramer commented Mar 13, 2012

This corrects some weird behavior we've seen by only running transactions on the current database. I know we briefly talked about transactions, but I want to confirm there are actual issues where migration A should rely on migration B, as that doesnt really seem like great design.

Specifically, each migration is run in its own transaction, and then syncdb is run, all within the single transaction. THis is committed and the next migration is run. Once all migrations are run on a database, it will run the loaddata command.

@@ -356,13 +368,8 @@ def execute_migrations(self, show_traceback=True):
database=db,
)
except Exception:
transaction.rollback(using=db)
sys.stdout.write("Rolled back all migrations on %r.\n" % db)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually this comment is now incorrect and I need to update it

@dcramer
Copy link
Contributor Author

dcramer commented Mar 13, 2012

Everything should be good now.

@paltman
Copy link
Collaborator

paltman commented Mar 14, 2012

@dcramer excellent. @brosner and I have talked about going back to original model of nashvegas where each migration was executed in it's own transaction. this looks more elegant than the original solution and am excited to dig in to this for a deeper review before merging this in. thanks for all your contributions to nashvegas!

paltman added a commit that referenced this pull request Apr 7, 2012
Change migrations to be transactional
@paltman paltman merged commit 94bc48f into paltman-archive:master Apr 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants