问题描述
我正在使用Liquibase 3.1.1在PostgreSQL 9.1中创建表.例如:
I'm using Liquibase 3.1.1 to create tables in PostgreSQL 9.1. For example:
<changeSet id="1" author="bob">
<createTable tableName="BATCHES">
<!-- .. -- >
</createTable>
</changeSet>
但是,该表是使用小写字母创建的:
However, the table gets created with a lowercase name:
# select * from "BATCHES";
ERROR: relation "BATCHES" does not exist
有什么方法可以让Liquibase生成DDL来保留我在变更日志中指定的表(和列等)名称的大小写?
Is there any way to have Liquibase generate DDL that preserves the case of the table (and column etc) names that I specify in the change log?
推荐答案
您可以在changeSet属性或databaseChangeLog根元素上使用objectQuotingStrategy ="QUOTE_ALL_OBJECTS"属性来覆盖仅引用必须包含以下内容的对象"的默认逻辑是"
You can use the objectQuotingStrategy="QUOTE_ALL_OBJECTS" attribute on your changeSet attribute or on the databaseChangeLog root element to override the default logic of "only quote objects that have to be"
这篇关于Liquibase/PostgreSQL:如何正确保留表大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!