准备
- 版本:4.26.0
- 安装,参考
初始化项目
liquibase init project --format=xml
注意:format的sql,不支持tagDatabase
启动h2
liquibase init start-h2
创建example-tag.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"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">
<changeSet author="liquibase-docs" id="createTable-example a">
<createTable catalogName="sample"
remarks="A String"
schemaName="public"
tableName="person2"
tablespace="A String">
<column name="address" type="varchar(255)"/>
</createTable>
</changeSet>
<changeSet author="liquibase-docs" id="tagDatabase-example">