本文主要是介绍liquibase的rollbak和tag实践,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
准备
- 版本: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"?>
<databaseChangeLogxmlns="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/dbchangeloghttp://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsdhttp://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsdhttp://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">
这篇关于liquibase的rollbak和tag实践的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!