Oracle 与Postgres分离,不替换changelog参数
我将liquibase与oracle和postgres一起使用,我想使用changeLog属性来定制两个数据库中不同的变更集元素 我使用的例子来自 这是我的db-changelog.xmlOracle 与Postgres分离,不替换changelog参数,oracle,postgresql,properties,liquibase,placeholder,Oracle,Postgresql,Properties,Liquibase,Placeholder,我将liquibase与oracle和postgres一起使用,我想使用changeLog属性来定制两个数据库中不同的变更集元素 我使用的例子来自 这是我的db-changelog.xml <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<property name="table.name" value="table_O" dbms="oracle"/>
<property name="table.name" value="table_P" dbms="postgres"/>
<property name="column1.name" value="column1_O" dbms="oracle"/>
<property name="column1.name" value="column1_P" dbms="postgres"/>
<property name="column2.name" value="column2_O" dbms="oracle"/>
<property name="column2.name" value="column2_P" dbms="postgres"/>
<property name="clob.type" value="blob" dbms="oracle"/>
<property name="clob.type" value="bytea" dbms="postgres"/>
<changeSet id="1" author="joe">
<createTable tableName="${table.name}">
<column name="id" type="int"/>
<column name="${column1.name}" type="${clob.type}"/>
<column name="${column2.name}" type="int"/>
</createTable>
</changeSet>
</databaseChangeLog>
工作正常,我获得了oracle的changelog,但是命令
$ liquibase --driver=oracle.jdbc.OracleDriver \
--classpath=ojdbc8-18.3.0.0.jar \
--changeLogFile=db.changelog.test.xml \
--url=jdbc:oracle:thin:@localhost:1521/my_db \
--username=my_user \
--password=my_pwd \
--logLevel debug updateSQL > simple_changeLog_ORACLE.sql
$ liquibase --driver=org.postgresql.Driver \
--classpath=postgresql-42.2.5.jar \
--changeLogFile=db.changelog.test.xml \
--url=jdbc:postgresql://localhost:15432/my_db \
--username=my_user \
--password=my_pwd \
--logLevel debug updateSQL > simple_changeLog_POSTGRES.sql
失败,出现以下异常
java.lang.ArrayIndexOutOfBoundsException: 1
at liquibase.datatype.DataTypeFactory.fromDescription(DataTypeFactory.java:251)
at liquibase.change.core.CreateTableChange.generateStatements(CreateTableChange.java:70)
at liquibase.change.AbstractChange.generateStatementsVolatile(AbstractChange.java:287)
at liquibase.change.AbstractChange.warn(AbstractChange.java:358)
at liquibase.changelog.visitor.ValidatingVisitor.visit(ValidatingVisitor.java:110)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83)
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:284)
at liquibase.Liquibase.update(Liquibase.java:198)
at liquibase.Liquibase.update(Liquibase.java:274)
at liquibase.Liquibase.update(Liquibase.java:251)
at liquibase.integration.commandline.Main.doMigration(Main.java:1433)
at liquibase.integration.commandline.Main.run(Main.java:229)
at liquibase.integration.commandline.Main.main(Main.java:143)
选项--logleveldebug显示解析的变更集中的差异
甲骨文是
17:59:43.184 DEBUG [liquibase.util.MD5Util]: Computed checksum for createTable:[
columns=[
[
name="id"
type="int"
],
[
name="column1_O"
type="blob"
],
[
name="column2_O"
type="int"
]
]
tableName="table_O"
] as 836321c599b350ca366cc6ea3bde3890
而博士后是
17:51:55.864 DEBUG [liquibase.util.MD5Util]: Computed checksum for createTable:[
columns=[
[
name="id"
type="int"
],
[
name="${column1.name}"
type="${clob.type}"
],
[
name="${column2.name}"
type="int"
]
]
tableName="${table.name}"
] as 71476a8361010689730a8bf91f8d7115
我遗漏了什么吗?我认为唯一的问题是postgres使用的值是
postgresql
,而不仅仅是postgres
数据库名称列表位于