我在postgres上使用以下参数运行liquibase:updateSQL
:
changelogSchemaName online
defaultCatalogName online
defaultSchemaName online
它生成类似CREATE TABLE product
的SQL,但我期望的是CREATE TABLE online.product
使用生成的SQL,用户search_path被使用,所以我需要修改我的数据库才能使用liquibase:update
任何想法如何解决这个问题?
答案 0 :(得分:1)
您是否使用了documentation中描述的 catalogName 属性?
例如:
<changeSet author="liquibase-docs" id="createTable-example">
<createTable catalogName="online" tableName="product"
<column name="x" type="varchar(255)"/>
<column name="y" type="varchar(255)"/>
</createTable>
</changeSet>
答案 1 :(得分:0)
使用outputDefaultCatalog=true
或outputDefaultSchema=true
maven参数。这将强制生成的SQL包含默认模式,即使它未在changeSet中指定。