Skip to content

Transaction based migrations #216

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

Closed
wzrdtales opened this issue Feb 9, 2015 · 2 comments
Closed

Transaction based migrations #216

wzrdtales opened this issue Feb 9, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@wzrdtales
Copy link
Member

Implement transactions per migration, thus everything gets rolled back on failure.

Notes:
Make it possible to deactivate transactions within the migrations.
Drivers gets flagged with transaction capability

@wzrdtales wzrdtales self-assigned this Feb 9, 2015
@wzrdtales wzrdtales added this to the v0.10.0 milestone Feb 9, 2015
@jarwol
Copy link
Contributor

jarwol commented Feb 19, 2015

Looking forward to this feature. Very easy to get your DB into a bad state when a migration you're testing fails halfway through.

@wzrdtales
Copy link
Member Author

Actually mysql doesn't support DDL Transactions for now. Luckily MariaDB is going to support this soon:

https://mariadb.atlassian.net/browse/MDEV-4259

Thus this issue is closed as transactions are now built in, but mysql still wont rollback any ddl actions such as drop table.

Nevertheless, migrations will get more intelligent in the next versions of db-migrate. So db-migrate knows about states, tables and metadata.
But this still wont fix a deleted table and restore the data within this, may be I will offer a dump table action on all ddl actions, which can optionally be activated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants