I have a changeSet generated from a MySQL database. A column of one table is of type=“LONGTEXT” which I understand allows text up to length 2^32 characters. Running this changeSet on a PostgreSQL database fails with the error ‘type “longtext” does not exist’. According to Postgres docs, type=“TEXT” is of unlimited length and thus would be a good fit for “LONGTEXT”. (http://www.postgresql.org/docs/8.2/interactive/datatype-character.html).
I expected Liquibase to know enough to map type=“LONGTEXT” to “TEXT” when applying to a Postgres database. Apparently this is not the case. Am I misunderstanding the goals of Liquibase? I’d like to maintain a single group of changelogs and be able to apply it to different types of databases. Is the best practice to maintain a separate line of changes for every database supported by my application? Or a primary line with some alternate changeSets configured with appropriate preconditions?
Edit: adding separate changesets with preconditions seems like it will work OK. It also seems that onFail=“MARK_RAN” is the most appropriate if I have, say, two changeSets, one for postgres and one for non-postgres (or eventually other databases should future incompatibilities be discovered).