2014-06-12 46 views
1

liqibase中的CHANGESET执行依赖于它在xml中的位置吗?例如,如果我有一个在liquibase脚本如下在随后的更新中,liquibase变更集排序更改是否更改?

<changeSet id="20140211_001" author="test"> 
    <createTable tableName="alarm_notification_archive"> 
     <column name="id" type="bigint"> 
      <constraints nullable="false" /> 
     </column> 

     <column name="event_timestamp" type="timestamp" defaultValue="0000-00-00 00:00:00"> 
      <constraints nullable="false" /> 
     </column> 
    </createTable> 
</changeSet> 

<changeSet id="20140210_001" author="test"> 
    <sql>ALTER TABLE `notification_archive` ADD COLUMN 
     `is_Alarm_Outstanding` BOOLEAN DEFAULT FALSE</sql> 
    <rollback> 
     <sql>ALTER TABLE notification_archive DROP COLUMN 
      is_Alarm_Outstanding 
       </sql> 
    </rollback> 
</changeSet> 

我的理解是变更排序是 1)20140211_001 2)20140210_001

如果我现在在添加其他变更1和2之间

<changeSet id="20140211_001" author="test"> 
    <createTable tableName="alarm_notification_archive"> 
     <column name="id" type="bigint"> 
      <constraints nullable="false" /> 
     </column> 

     <column name="event_timestamp" type="timestamp" defaultValue="0000-00-00 00:00:00"> 
      <constraints nullable="false" /> 
     </column> 
    </createTable> 
</changeSet> 

<changeSet id="20140212_001" author="test"> 
    <sql>ALTER TABLE `notification_archive` ADD COLUMN 
     `is_Alarm_Outstanding` BOOLEAN DEFAULT FALSE</sql> 
    <rollback> 
     <sql>ALTER TABLE alarm_notification_archive DROP COLUMN 
      is_Alarm_Outstanding 
      </sql> 
    </rollback> 
</changeSet> 

<changeSet id="20140210_001" author="test"> 
    <sql>ALTER TABLE `notification_archive` ADD COLUMN 
     `is_Alarm_Outstanding` BOOLEAN DEFAULT FALSE</sql> 
    <rollback> 
     <sql>ALTER TABLE alarm_notification_archive DROP COLUMN 
      is_Alarm_Outstanding 
      </sql> 
    </rollback> 
</changeSet> 

将新变更的执行顺序是 1)20140211_001 2)20140212_001 3)20140210_001

回答