-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Implement all or nothing transaction strategy for migrations. #683
Conversation
a18b89a
to
9e23538
Compare
19856c5
to
4c35bf1
Compare
@@ -24,6 +24,7 @@ | |||
</xs:simpleType> | |||
</xs:element> | |||
<xs:element type="xs:string" name="migrations-directory" minOccurs="0" maxOccurs="1"/> | |||
<xs:element type="xs:string" name="all-or-nothing" minOccurs="0" maxOccurs="1"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoudln't it be xs:bool
?
146e747
to
ea336e8
Compare
ea336e8
to
acbe335
Compare
@@ -70,6 +70,8 @@ file like the following: | |||
|
|||
<migrations-directory>/path/to/migrations/classes/DoctrineMigrations</migrations-directory> | |||
|
|||
<all-or-nothing>1</all-or-nothing> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is 1...
|
||
<migrations-directory>/path/to/migrations/classes/DoctrineMigrations</migrations-directory> | ||
|
||
<all-or-nothing>true</all-or-nothing> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... here it is true.
Should be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs were updated and fixed at some point in the future. FYI, we take the string from the XML and pass it through this class https://github.com/doctrine/migrations/blob/master/lib/Doctrine/Migrations/Tools/BooleanStringFormatter.php here https://github.com/doctrine/migrations/blob/master/lib/Doctrine/Migrations/Configuration/XmlConfiguration.php#L89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback
|
||
If you want your migrations to be all or nothing then you can configure your migrations behave that way. | ||
This means when you executed multiple migrations in a row, the whole migration will be wrapped | ||
in a single migration and if one of the migrations fails, the transaction will be rolled back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapped in a single transaction
looks like a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it. Can you check if it still exists in master and record an issue to fix it if so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwage oh, didn't realize that the PR is so old 😅
The whole paragraph is gone in 2.0 and I couldn't find it in 1.8 either (that's where this PR landed).
So probably already fixed then. 👍
Sorry for the noise.
Summary
Implement all or nothing transaction strategy for migrations.