Issue
I don't know how to check two columns in table migration. I use liquibase. I wanna to make something like this:
"preConditions": [
{
"onFail": "MARK_RAN",
"not": {
"columnExists": {
"columnName": "first_column",
"tableName": "my_table"
},
"columnExists": {
"columnName": "second_column",
"tableName": "my_table"
}
}
}
]
Solution
not is supposed to be an array of objects. It may add additional logic by using an “and” (default value) or “or” operators.
I’d go with the following:
"preConditions": [{
"onFail": "MARK_RAN",
"not": [{
"and": [{
"columnExists": {
"columnName": "first_column",
"tableName": "my_table"
}
}, {
"columnExists": {
"columnName": "second_column",
"tableName": "my_table"
}
}]
}]
}]
Answered By - htshame Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.