-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Rollback if and only if inside a transaction #1143
Conversation
Similarly to what happens when attempting to commit an already closed connection when combining PHP 8 and pdo_mysql, an error is thrown when attempting to rollback. We use the same solution as for commit(), that is we check that we actually are inside a transaction when possible to do so. Fixes doctrine#1139
67ea956
to
6d17f69
Compare
You cannot get an integer from the CLI, so it makes no sense to use an integer as the default option.
@AntoineRoue please review and test |
@greg0ire I've just seen your message, is it ok or do you still need me to test ? |
It's best if you test, if you can't we'll merge as is. |
Ok no problem. I had issues with composer auth token yesterday but I think there is a recent update that fixes it. I'll try this evening. |
@greg0ire I managed to get your work, but when I run any doctrine command, I have the error |
I know that the last version of the migrations bundle is buggy, not sure if that is why you experience this. When you installed my fork, did any other package upgrade as well? In particular, did the migrations bundle upgrade? |
At first I could not install your package and the migration bundle package because of the dependency to "doctrine/migrations: ^3.1" in doctrine-migrations-bundle. |
Yes, I'm targeting 2.3.x since it has the bug too |
I just pushed a branch that is the result of the merge of 3.1.x and this one so that you can test. composer config repositories.greg0ire vcs https://github.com/greg0ire/doctrine-migrations
composer require doctrine/migrations "dev-upmerge-rollback-iff-in-transaction as 3.1.1" |
Oh I didn't realize that ! By the way, your first command should be |
Ok, we did it! I was able to test it, and your fix works. |
Great, thanks @AntoineRoue , and good luck with that certification! |
Summary
Similarly to what happens when attempting to commit an already closed
connection when combining PHP 8 and pdo_mysql, an error is thrown when
attempting to rollback. We use the same solution as for commit(), that
is we check that we actually are inside a transaction when possible to do so.
Fixes #1139
How can I test this?
composer config repositories.greg0ire vcs https://github.com/greg0ire/doctrine-migrations composer require doctrine/migrations "dev-rollback-iff-in-transaction as 2.3.3"