-
Notifications
You must be signed in to change notification settings - Fork 82
Documented try_catch (and sql: execute) in migrations #3060
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
base: 5.0
Are you sure you want to change the base?
Conversation
Preview of modified filesPreview of modified Markdown: |
| @@ -0,0 +1,13 @@ | |||
| - | |||
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.
| @@ -0,0 +1,14 @@ | |||
| - | |||
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.
Tested locally:
09:15:17 NOTICE [app] Executing migration: "l5"
09:15:17 INFO [app] Processing step: 0
09:15:17 INFO [app] Type "try_catch" | Mode: "execute" | Matching step: "Ibexa\Migration\ValueObject\Step\TryCatchStep"
09:15:17 INFO [app] Processing step: 0
09:15:17 INFO [app] Type "language" | Mode: "create" | Matching step: "Ibexa\Migration\ValueObject\Step\LanguageCreateStep"
✅ Migration l5 finished executing.
| ``` | ||
|
|
||
| When an exception is thrown within a try-catch step, it's compared against the list of `allowed_exceptions`. | ||
| If the exception matches, it's caught and the migration continues or stops depending on the `stop_after_first_exception` configuration setting. |
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.
In both cases migration is treated as if it succeeded.
Non-matching exceptions throw immediately just like before.
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! Added in af4288e
|
code_samples/ change report
|



Target: 5.0 (we need to wait until it's released)
Adding doc for https://github.com/ibexa/migrations/pull/430
In addition, because it was missing, I've added doc for the "sql: execute" step (this might be cherry-picked to 4.6 as well)