hi i have a problem when adding unique constraint creation to my change log. in logs it shows the liquibase is reading change sets but i still cant find the unique constraint through query . the problem is it is only applied when i recreate database it doesn't work if table exists before.
<changeSet id="20220524-1" author="Saba Mosleh">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">
SELECT DISTINCT count(CONSTRAINT_NAME) FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE
TABLE_NAME = 'voucher_codes' AND CONSTRAINT_TYPE = 'UNIQUE' and CONSTRAINT_NAME = 'unique_voucher_code';
</sqlCheck>
</preConditions>
<addUniqueConstraint tableName="voucher_codes" columnNames="code" constraintName="unique_voucher_code"/>
</changeSet