0
我試圖通過liquibase運行SQL腳本,我設置一個屬性MY_USER_NAME這樣
${MY_USER_NAME}
,但當我嘗試在我的sql文件中使用它時,由於某種原因運行liquibase時,前括號正在被刪除,所以不是評估我的屬性,而是以$ Y_USER_NAME}結尾
我有我的主變更日誌文件master.xml
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<include relativeToChangelogFile="true" file="changelogs.xml"/>
而且我changelogs.xml是
<?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.4.xsd">
<property name="MY_USER_NAME" value="LALA"/>
<include relativeToChangelogFile="true" file="TEST.sql"/>
</databaseChangeLog>
TEST.SQL
drop table ${MY_USER_NAME};