Transaction boundaries #209
Replies: 6 comments 3 replies
-
Each migration is executed in a separate database transaction. Thus each script will either succeed or fail completely and Evolve will stop on the first error (here in the documentation). So all changes from the successful scripts are applied. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the fast reply!
Not having a parent transaction would be a roadblock for us adopting
Evolve. How feasible would adding a parent transaction be? Either
optionally or always?
|
Beta Was this translation helpful? Give feedback.
-
That sounds great!
The database would be SQL Server (>=2014, Standard Edition).
Some name ideas:
- Transaction, TransactionLevel, TransactionScope = {Command, Migration}
or {All, Each} or {CommitAll, CommitEach}
Also, if there could be an option or command to trigger a rollback without
error after the last successful script, that would be very useful. That way
upgrades could be tested against an existing database prior to doing the
real thing. Also useful to verify new SQL scripts automatically in a CI
setup or before running in a high-risk production environment. That could
either be a new command (ideas: test-migrate) or an option (ideas:
Test=true, Transaction=RollbackAll).
My vote would be Transaction={CommitAll, CommitEach, RollbackAll}.
Happy to talk more if needed. Thanks for your help!
|
Beta Was this translation helpful? Give feedback.
-
Evolve 3.0.0-alpha5 is released. Feel free to test the new option |
Beta Was this translation helpful? Give feedback.
-
Thanks! I skimmed the changes and didn't see anything that looked off. I'm
working to get into a sprint for my team to review as part of their tool
evaluation.
|
Beta Was this translation helpful? Give feedback.
-
The new TransactionMode options seems to be working great from the CLI.
Thanks again!
…On Mon, Mar 8, 2021 at 1:03 PM Matt Hooper ***@***.***> wrote:
Thanks! I skimmed the changes and didn't see anything that looked off. I'm
working to get into a sprint for my team to review as part of their tool
evaluation.
On Sun, Mar 7, 2021 at 5:54 PM Philippe Lécaillon <
***@***.***> wrote:
> *Evolve 3.0.0-alpha5* is released. Feel free to test the new option
> TransactionMode either with value CommitAll or RollbackAll.
> Waiting for your feedback @matthooper <https://github.com/matthooper>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#209 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAER5QXHJMTPZTYRGMVLMO3TCP7ZNANCNFSM4YRL2KSQ>
> .
>
|
Beta Was this translation helpful? Give feedback.
-
What happens if during a single CLI migration run, several scripts succeed and then a subsequent one fails? Are all changes from the successful scripts in that migration run rolled back or only the changes in the failed script rolled back?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions