2
我正在使用Liquibase java API從databaseChangeLog文件更新我的數據庫。我使用下面的代碼還設置默認數據庫模式:從Liquibase Java API訪問佔位符
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn));
database.setDefaultSchemaName(CustomerPortalServiceBeanFactory.getInstance().getServiceConfigurationData().getSchemaName());
能正常工作,除非我有一個創建一個視圖更改日誌,如下圖所示:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet author="mhills" id="customerUser-view">
<createView
replaceIfExists="true"
viewName="CUSTOMER_USER_VW">
select
customeruser.id,
customeruser.status,
customeruser.customer_id,
customeruser.contact_id,
customeruser.email_address,
customeruser.online_name,
customeruser.date_created
FROM customer_user customeruser
</createView>
</changeSet>
</databaseChangeLog>
的SCHEMANAME正確前綴視圖名稱,但我也需要在from子句中使用的表格的前綴。模式名稱是否可用作佔位符,或者有其他方法可以完成此任務嗎?