Short Version I’m looking for a uniqueConstraintExists precondition, or something that will accomplish the scenario below.
I’m switching from an unmanaged database (previously schema generated by JPA provider) to one managed by liquibase to help developer onboarding and ease migration. For the existing schema, I simply added preconditions that will get onFail=“MARK_RAN” when the elements already exist. I don’t want to do this for any new elements.
- Developers needs to support the liquibase -> construct brand new empty DB
- Production,stage,test needs to support the liquibase -> continue where we left off the schema for all new changes
The problem I’m having is that in the pre-liquibase schema, there are unique constraints. There isnt’ a precondition that I could check for existence and then just not run them. I see three options:
- Don’t use liquibase to create the unique constrain on the old data
- write a custom precondition
- fabricate a ran changeset that include the unique constraint in the product,testing, databasechangelog table.
Any other options? Am I missing a uniqueConstraintExists precondition?
I’m using:
liquibase 1.9.5.0
PostgreSQL 8.4.3
Thanks in advance!