什么是liquibase

liquibase是开源的数据库跟踪,管理工具,比如数据库表的更改变化,回滚等。

所有的数据库变化比如表增加列都会存储到XML,JSON或者SQL中。比较适合多团队写作开发,用来共享资源。LIquibase会自动的创建DatabaseChangeLog数据库表和DatabaseChangeLogLock表和里边的每次更改记录。

liquibase现在支持10种常用的数据库类型,比如说MySQL。

给大家感受一下它的XML文件:

<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.3"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.3
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.3.xsd">
    <preConditions>
            <dbms type="oracle"/>
    </preConditions>

    <changeSet id="1" author="author1">
        <createTable tableName="persons">
            <column name="id" type="int" autoIncrement="true">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="name" type="varchar(50)"/>
        </createTable>
    </changeSet>
</databaseChangeLog>

使用liquibase的好处:数据库独立性,自动化的文档,每次数据库变化的diff等。

 

官网地址:https://www.liquibase.org/

原文:http://blog.youkuaiyun.com/hongchangfirst/article/details/89742176

作者:hongchangfirst

hongchangfirst的主页:http://blog.youkuaiyun.com/hongchangfirst

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值