Actually, it is necessary to manually correct the data types in the generated file. Data types are not converted automatically.
For example:
- ...
- <changeSet author="Alexey (generated)" id="1409146335011-53">
- <createTable tableName="TABLE1A">
- <!-- replace INT8 to NUMBER(16) for Oracle (for example) -->
- <column name="total_pk" type="INT8">
- <constraints nullable="false"/>
- </column>
- <!-- replace INT4 to NUMBER(10) for Oracle (for example) -->
- <column name="form_fk" type="INT4">
- <constraints nullable="false"/>
- </column>
- ...
After that execute the command:
- liquibase
- --driver=oracle.jdbc.OracleDriver
- --classpath="C:\db_drivers\ojdbc14.jar"
- --changeLogFile="./postgresql_changelog.xml"
- --url="jdbc:oracle:thin:@ip_here:orabeta"
- --username=***
- --password=***
- update
The structure will be generated on the target database. Is similarly possible migrate the data (option --diffTypes = "data").
But, really, can be used "abstract" data types, as write in the documentation: Liquibase, Column tag
To help make scripts database-independent, the following “generic” data types will be converted to the correct database implementation: BOOLEAN CURRENCY UUID CLOB BLOB DATE DATETIME TIME BIGINT
Also, specifying a java.sql.Types.* type will be converted to the correct type as well. If needed, precision can be included. Here are some examples: java.sql.Types.TIMESTAMPjava.sql.Types.VARCHAR(255)
And possible to make the copy of structure without DDL (and data without DML).