运行 SQL 个文件(如果已更改)或 运行 个新的 SQL 个文件夹中包含 Liquibase 的文件
Run SQL Files If Changed or Run New SQL Files in Folder with Liquibase
我有一个 sql 文件夹和 sql 个文件。
我想 运行 此文件夹中的所有更改。
例如:如果新 sql 文件添加到 sql 文件夹,我想 运行 它或者如果新行被添加到这个文件夹中的文件之一,我想 运行 只有新行。有没有可能用 Liquibase 做这个?
这是我的更新日志 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.1.xsd">
<changeSet id="1359722450-38" author="garip" runOnChange="true">
<sqlFile endDelimiter="" splitStatements="false" path="../sql/sql1.sql"
relativeToChangelogFile="true" />
</changeSet>
</databaseChangeLog>
尝试在没有更改日志的情况下合并 Liquibase (http://www.liquibase.org/2015/09/liquibase-without-changelogs.html) and runOnChange option (http://www.liquibase.org/documentation/changeset.html),但是 "if new lines are added to one of the files in this folder, I want to run only new lines" 是不可能的 - 您可以 运行 只有更改了整个文件。
你会出问题的地方就是请求
...or if new lines are added to one of the files in this folder, I want
to run only new lines.
Liquibase 只会 运行 整个 SQL 脚本。为了仅 运行 'new' 行,它必须解析和理解所有不同的 SQL 方言,而 Liquibase 不会这样做。
我有一个 sql 文件夹和 sql 个文件。
我想 运行 此文件夹中的所有更改。 例如:如果新 sql 文件添加到 sql 文件夹,我想 运行 它或者如果新行被添加到这个文件夹中的文件之一,我想 运行 只有新行。有没有可能用 Liquibase 做这个?
这是我的更新日志 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.1.xsd">
<changeSet id="1359722450-38" author="garip" runOnChange="true">
<sqlFile endDelimiter="" splitStatements="false" path="../sql/sql1.sql"
relativeToChangelogFile="true" />
</changeSet>
</databaseChangeLog>
尝试在没有更改日志的情况下合并 Liquibase (http://www.liquibase.org/2015/09/liquibase-without-changelogs.html) and runOnChange option (http://www.liquibase.org/documentation/changeset.html),但是 "if new lines are added to one of the files in this folder, I want to run only new lines" 是不可能的 - 您可以 运行 只有更改了整个文件。
你会出问题的地方就是请求
...or if new lines are added to one of the files in this folder, I want to run only new lines.
Liquibase 只会 运行 整个 SQL 脚本。为了仅 运行 'new' 行,它必须解析和理解所有不同的 SQL 方言,而 Liquibase 不会这样做。