Is there a way to conditionally specify column types in Liquibase while creating a table? For example –
- enum for MySQL, as per this: http://dev.mysql.com/doc/refman/5.0/en/enum.html
- column with check constraints for Oracle to enforce enum-like behaviour
- simply char(1) for all other DBs
Regards,
Shantanu
Yes, there are a few ways. There is modifySql, changelog parameters, and custom SqlGenerator (http://liquibase.org/extension) classes you can write.
With changelog params, you would define your changeSet like and at the top of the changeLog you can a tag for each database. That may be the easiest approach and should work for you.
Nathan