Here is what I have tried so far:
<changeSet id="1" author="nobody" context="x">
<comment>Ensure rank is between 0 and 100 inclusive</comment>
<sql>
ALTER TABLE User ADD CONSTRAINT chk_your_column CHECK (rank BETWEEN 1 AND 100);
</sql>
Does Liquibase provide a built-in feature or tag to add min/max value constraints for an integer column, or is using raw SQL the only option? I haven’t found it in Liquibase documentation.
- If Liquibase does support this directly, what is the correct way to implement it?
- If not, are there any recommended best practices or alternative approaches for adding such constraints using Liquibase?
Note: uses 3 databases : mssql, mysql ,oracle