Liquibase:changeLog继承校验和失败

时间:2015-02-20 10:53:00

标签: database liquibase

我已将已成为巨大的Liquibase changeLog.xml 拆分为 sub-changeLogs.xml (一个按应用程序版本)。

但出乎意料的是,已经应用changeSet的校验和验证失败了。

经过调查,似乎Liquibase对声明sql文件(changeSet)的所有sub-changelog.xml的所有<sqlFile ... />使用相同的校验和(在???上计算)...

我是否遗漏了某些东西,或者它是否是Liquibase不支持的功能?

由于


原始changelog.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.1.xsd">

    <!-- ... -->

    <changeSet id="PIETRAN-1682" author="liquibase" logicalFilePath="scripts/2.38.0/PIETRAN-1682.sql">
        <sqlFile relativeToChangelogFile="true" path="scripts/2.38.0/PIETRAN-1682.sql" />
    </changeSet>

    <changeSet id="PIETRAN-1682-2" author="liquibase" logicalFilePath="scripts/2.38.0/PIETRAN-1682-2.sql">
        <sqlFile relativeToChangelogFile="true" path="scripts/2.38.0/PIETRAN-1682-2.sql" />
    </changeSet>

    <changeSet id="PIE-10938" author="liquibase" logicalFilePath="scripts/2.38.0/PIE-10938.sql">
        <sqlFile relativeToChangelogFile="true" path="scripts/2.38.0/PIE-10938.sql" />
    </changeSet>

    <changeSet id="version-2.38.0" author="liquibase" logicalFilePath="n/a tag=2.38.0">
        <tagDatabase tag="2.38.0"/>
    </changeSet>


    <changeSet id="2.39.0-dml" author="liquibase" logicalFilePath="scripts/2.39.0/2.39.0-ddl.sql">
        <sqlFile relativeToChangelogFile="true" path="scripts/2.39.0/2.39.0-ddl.sql"/>
    </changeSet>

    <changeSet id="PIE-10894" author="liquibase" logicalFilePath="scripts/2.39.0/PIE-10894.sql">
        <sqlFile relativeToChangelogFile="true" path="scripts/2.39.0/PIE-10894.sql"/>
    </changeSet>

    <changeSet id="PIE-10915" author="liquibase" logicalFilePath="scripts/2.39.0/PIE-10915.sql">
        <sqlFile relativeToChangelogFile="true" path="scripts/2.39.0/PIE-10915.sql"/>
    </changeSet>

    <changeSet id="version-2.39.0" author="liquibase" logicalFilePath="n/a tag=2.39.0">
        <tagDatabase tag="2.39.0"/>
    </changeSet>

    <!-- ... -->
</databaseChangeLog>

拆分changelog.xml

主changelog.xml

<!-- ... -->
<include relativeToChangelogFile="true" file="scripts/2.38.0/changeLog.xml" />
<include relativeToChangelogFile="true" file="scripts/2.39.0/changeLog.xml" />
<!-- ... -->
  • 更改日志-2.38.xml

    包含前四个changeSet

  • 更改日志-2.39.xml

    包含最后四个changeSet

校验和比较

<style type="text/css">
  .tg {
    border-collapse: collapse;
    border-spacing: 0;
  }
  .tg td {
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 10px 5px;
    border-style: solid;
    border-width: 1px;
    overflow: hidden;
    word-break: normal;
  }
  .tg th {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: normal;
    padding: 10px 5px;
    border-style: solid;
    border-width: 1px;
    overflow: hidden;
    word-break: normal;
  }
  .tg .tg-hgcj {
    font-weight: bold;
    text-align: center
  }
  .tg .tg-uhkr {
    background-color: #ffce93
  }
  .tg .tg-lkh3 {
    background-color: #9aff99
  }
</style>
<table class="tg">
  <tr>
    <th class="tg-hgcj">id</th>
    <th class="tg-hgcj">file</th>
    <th class="tg-hgcj">description</th>
    <th class="tg-hgcj">md5sum (ORIGINAL)</th>
    <th class="tg-hgcj">md5sum (NEW)</th>
  </tr>
  <tr>
    <td class="tg-031e">PIETRAN-1682.sql</td>
    <td class="tg-031e">scripts/2.38.0/PIETRAN-1682.sql</td>
    <td class="tg-031e">sqlFile</td>
    <td class="tg-031e">7:dd1a94fb6b9da96990ece716ad312b3f</td>
    <td class="tg-uhkr">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
  </tr>
  <tr>
    <td class="tg-031e">PIETRAN-1682-2</td>
    <td class="tg-031e">scripts/2.38.0/PIETRAN-1682-2.sql</td>
    <td class="tg-031e">sqlFile</td>
    <td class="tg-031e">7:73422229ea186af5f8500ff160ef45d5</td>
    <td class="tg-uhkr">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
  </tr>
  <tr>
    <td class="tg-031e">PIE-10938.sql</td>
    <td class="tg-031e">scripts/2.38.0/PIE-10938.sql</td>
    <td class="tg-031e">sqlFile</td>
    <td class="tg-031e">7:9ade6099c24da620a6b67d00d9ea9942</td>
    <td class="tg-uhkr">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
  </tr>
  <tr>
    <td class="tg-031e">version-2.38.0</td>
    <td class="tg-031e">n/a tag=2.38.0</td>
    <td class="tg-031e">tagDatabase</td>
    <td class="tg-lkh3">7:9895aaa1ae62f6b2dd79573f3f207f39</td>
    <td class="tg-lkh3">7:9895aaa1ae62f6b2dd79573f3f207f39</td>
  </tr>
  <tr>
    <td class="tg-031e">2.39.0-dml</td>
    <td class="tg-031e">scripts/2.39.0/2.39.0-ddl.sql</td>
    <td class="tg-031e">sqlFile</td>
    <td class="tg-031e">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
    <td class="tg-uhkr">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
  </tr>
  <tr>
    <td class="tg-031e">PIE-10894</td>
    <td class="tg-031e">scripts/2.39.0/PIE-10894.sql</td>
    <td class="tg-031e">sqlFile</td>
    <td class="tg-031e">7:666e799f34604f7daf85a54bb79e51cc</td>
    <td class="tg-uhkr">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
  </tr>
  <tr>
    <td class="tg-031e">PIE-10915</td>
    <td class="tg-031e">scripts/2.39.0/PIE-10915.sql</td>
    <td class="tg-031e">sqlFile</td>
    <td class="tg-031e">7:502ec7315f0d16cd6533aa4a475adc02</td>
    <td class="tg-uhkr">7:f5032ab5d66464c5d77ca62f90ca05ad</td>
  </tr>
  <tr>
    <td class="tg-031e">version-2.39.0</td>
    <td class="tg-031e">n/a tag=2.39.0</td>
    <td class="tg-031e">tagDatabase</td>
    <td class="tg-lkh3">7:ea227f77515580448821fd4517f5c96f</td>
    <td class="tg-lkh3">7:ea227f77515580448821fd4517f5c96f</td>
  </tr>
</table>


更新

我在Liquibase团队的bug跟踪器上打开了issue,问题将在版本3.4中修复。

0 个答案:

没有答案