0
私はLiquiBaseを介してSQLスクリプトを実行しようと、私はこの
${MY_USER_NAME}
のようなプロパティMY_USER_NAMEを設定しますが、何らかの理由でliquibaseを実行したときにそれを私のSQLファイルで使用しようとすると、開始括弧が削除されているので、$ Y_USER_NAMEで終了するプロパティを評価する代わりに
master changelogファイル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"/>
私は、SQLファイルをSQLで評価される性質があるべきためには、私の問題への解決策を見つけた
そして、私の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};