-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix serialization of DatabaseChangeLog with 'preConditions' for yaml #6118
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
Conversation
Hey @mariochampion, Today we were discussing about this changes made here with @tati-qalified and we realized now for YAML format (as well as for JSON) we are accepting two different formats on how to write preconditions on a changelog: preConditions:
- or:
- sqlCheck:
expectedResult: 0
sql: select count(*) from team
- not:
- sqlCheck:
expectedResult: 0
sql: select count(*) from referenced_table
onError: HALT
onFail: HALT
onFailMessage: Some message
onSqlOutput: IGNORE and the other preconditions:
preConditions:
nestedPreconditions:
- or:
nestedPreconditions:
- sqlCheck:
expectedResult: '0'
sql: select count(*) from team
- not:
nestedPreconditions:
- sqlCheck:
expectedResult: '0'
sql: select count(*) from referenced_table
onError: HALT
onFail: HALT
onFailMessage: Some message
onSqlOutput: IGNORE The first one is the "original" and the second option is the "new" one after implementing these changes. I wanted to double-check with you whether this is acceptable or not. I think it's good we allow both to keep backward compatibility, but at the same time I think this could be a bit confusing for users. We said we will document this approach in the docs, but I would like to know what do you think about it. cc: @lbadam @filipelautert Thanks, |
[DOC INTERNAL] https://datical.atlassian.net/browse/PD-4954 |
…6118) * YamlSerializer changes needed for processing preconditions and its nested preconditions correctly. * Removed un-needed line from toMap method. * Removed unneeded import, plus remove some if/else idententations updated. * Preconditions support added to recognized and process preconditions and nestedPreconditions nodes.
Impact
Description
Fixes #4379
When serializing a changelog like the one below:
it was producing a changelog like the one below:
Class names have been removed from the
onError
,onFail
, etc. Also, the required support to recognize and process correctlypreconditions
andnestedPreconditions
node have been added.Things to be aware of
Things to worry about
Additional Context