官术网_书友最值得收藏!

The changelog file

The following is an example of what a Liquibase changelog file can look like.

It defines two changesets, or migrations, with the numerical identifiers 1 and 2:

  • Changeset 1 creates a table called customer, with a column called name
  • Changeset 2 adds a column called address to the table called customer
    <?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.0.xsd">
    
      <changeSet id="1" author="jave">
    
        <createTable tableName="customer">
          <column name="id" type="int"/>
          <column name="name" type="varchar(50)"/>
        </createTable>
      </changeSet>
    
      <changeSet id="2" author="jave">
        <addColumn  tableName="customer">
            <column name="address" type="varchar(255)"/>
        </addColumn>
      </changeSet>
    
    </databaseChangeLog>
主站蜘蛛池模板: 霞浦县| 庆阳市| 祁阳县| 阿图什市| 巨野县| 阿合奇县| 普定县| 太白县| 永清县| 全南县| 常宁市| 宾川县| 壤塘县| 延边| 浦江县| 长垣县| 金沙县| 当雄县| 奉化市| 溧水县| 普格县| 商洛市| 闽侯县| 萨迦县| 利津县| 始兴县| 台湾省| 花莲市| 天祝| 宜丰县| 凤城市| 昌黎县| 东莞市| 铁力市| 仲巴县| 南通市| 瓮安县| 丹阳市| 蛟河市| 罗江县| 阿拉善左旗|