Below link has the data types that is “generic” defined in Liquibase, or we can use “java.sql.Types.*” . “updateDatabase” can take it very well.
http://www.liquibase.org/manual/column
But is there a way to have “generateChangelog” generate xml in this fashion? A concrete example is:
“generateChangelog” currently generates this:
How can we get it to generate below:
The advantage is that one xml can support multiple DBs.
Thanks,
riceball
Currently we do not have logic in liquibase to convert from database specific types to generic types. When we get the column metadata from the database it is a database-specific type, and my concern has generally been that we may loose expected datatype characteristics (special features of varchar2 vs varchar, precision may be off slightly) when converting to generic types.
What I would recommend is using the generateChangeLog to create your starting changelog xml file, then creating an XML parser to modify the particular datatypes you need changed to the generic type you expect them to be.
I’ve done this with mysql->mssql, and using dom and xpath it is not a difficult thing to do.
Thanks for the suggestion! It makes sense!