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

Wrap migration in a transaction? #62

Closed
mgersten-caxy opened this issue Jul 24, 2013 · 2 comments
Closed

Wrap migration in a transaction? #62

mgersten-caxy opened this issue Jul 24, 2013 · 2 comments

Comments

@mgersten-caxy
Copy link

Is there any reason why migrations (up, down) aren't wrapped in a transaction by default? This would seem like a nice feature to have.

@stof
Copy link
Member

stof commented Jul 24, 2013

First, this is the wrong place to ask for it as this bundle does not implement migrations. It only integrates it with Symfony

And the reason why they are not in transaction is simple: support in RDBMS is totally inconsistent for this.
For instance, MySQL does support altering tables in a transaction. If you try to do it, it will commit the current transaction, then alter the table outside it and then start a new transaction for the next part. So doing a rollback would only rollback changes done after the last altering.

@stof stof closed this as completed Jul 24, 2013
@wadjeroudi
Copy link

https://www.doctrine-project.org/projects/doctrine-migrations/en/latest/reference/configuration.html#all-or-nothing-transaction

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

No branches or pull requests

3 participants