on-internet
← Community

Check if the unique constraint exists and drop it using liquibase

Stack Overflow ·

I have a changeset wherein I initially check if the unique constraint exists and then if it does it will drop the constraint. <changeSet author="loren" id="DROP_UNIQUE_CONSTRAINT_RULEPRIORITY_ORACLE_v1" dbms="oracle"> <preConditions onFail="MARK_RAN"> <sqlCheck expectedResult="1"> SELECT COUNT(*) FROM USER_CONSTRAINTS WHERE CONSTRAINT_NAME='UC_RULES_PRIORITY' </sqlCheck> </preConditions> <dropUniqueConstraint constraintName="UC_RULES_PRIORITY" schemaName="${main.schema}" tableName="RULES"/> </changeSet> The issue with this is it does not seem to pass the precondition. It always says MARK_RAN m

Comments

Sign in or sign up to comment and upvote.

No comments yet.