Liquibase

Liquibase is an open-source database-independent library for tracking, managing and applying database schema changes. It was started in 2006 to allow easier tracking of database changes, especially in an agile software development environment.

Liquibase
Developer(s)Nathan Voxland
Stable release
3.9.0 / May 14, 2020 (2020-05-14)[1]
Written inJava
Operating systemCross-platform
TypeSoftware development
LicenseApache License 2.0
Websitehttp://www.liquibase.org/

Overview

All changes to the database are stored in text files (XML, YAML, JSON or SQL) and identified by a combination of an "id" and "author" tag as well as the name of the file itself. A list of all applied changes is stored in each database which is consulted on all database updates to determine what new changes need to be applied. As a result, there is no database version number but this approach allows it to work in environments with multiple developers and code branches.

Liquibase automatically creates DatabaseChangeLog Table and DatabaseChangeLogLock Table when you first execute a changeLog File.

Major functionality

  • Over 30 built-in database refactorings
  • Extensibility to create custom changes
  • Update database to current version
  • Rollback last X changes to database
  • Rollback database changes to particular date/time
  • Rollback database to "tag"
  • SQL for Database Updates and Rollbacks can be saved for manual review
  • Stand-alone IDE and Eclipse plug-in
  • "Contexts" for including/excluding change sets to execute
  • Database diff report
  • Database diff changelog generation
  • Ability to create changelog to generate an existing database
  • Database change documentation generation
  • DBMS Check, user check, and SQL check preconditions
  • Ability to split change log into multiple files for easier management
  • Executable via command line, Apache Ant, Apache Maven, servlet container, or Spring Framework.
  • Support for 10 database systems

Commercial Version

Liquibase (formerly Datical)[2] is both the largest contributor to the Liquibase project and the developer of Liquibase Enterprise [3] – a commercial product which provides the core Liquibase functionality plus additional features.

  • Change Forecasting: Forecast upcoming changes to be executed before they are run to determine how those changes will impact your data.[4]
  • Rules Engine to enforce Corporate Standards and Policies.[5]
  • Supports database Stored Logic: functions, stored procedures, packages, table spaces, triggers, sequences, user defined types, synonyms, etc.
  • Compare Databases enables you to compare two database schemas to identify change and easily move it to your change log.
  • Change Set Wizard to easily define and capture database changes in a database neutral manner.
  • Deployment Plan Wizard for modeling and managing your logical deployment workflow
  • Plug-ins to Jenkins, Bamboo, UrbanCode, CA Release Automation (Nolio), Serena Release Automation, BMC Bladelogic, Puppet, Chef,[6] as well all popular source control systems like SVN, Git, TFS, CVS, etc.

Liquibase products, including Liquibase Enterprise (formerly known as Datical DB), are used by DBAs, Release Managers, DevOps teams, Application Owners, Architects, and Developers involved in the Application Release process. It manages Database Schema changes together with application code in a programmatic fashion that eliminates errors and delays and enables rapid Agile releases. Liquibase commercial products build upon the Liquibase Data Model Approach for managing data structure specific content across application versions as they advance from Development to Test to Production environments. Datical previews the impact of Schema changes in any environment before deployment thus mitigating risk and resulting in smoother and faster application changes.

Liquibase developer, Nathan Voxland, is an executive at Liquibase (formerly Datical). [7]

Sample Liquibase ChangeLog file

<?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>

    <changeSet id="2" author="author2" context="test">
        <insert tableName="persons">
            <column name="id" value="1"/>
            <column name="name" value="Test1"/>
        </insert>
        <insert tableName="persons">
            <column name="id" value="2"/>
            <column name="name" value="Test2"/>
        </insert>
    </changeSet>
</databaseChangeLog>
gollark: Sure? I would move it to beside <#733816666089062511> but mobile.
gollark: Heavpoot is to be declared SCP-3125-A with immediate effect.
gollark: My tape download program now supports downloading big files without splitting them, via range requests, assuming they're served from a server which supports it: https://pastebin.com/LW9RFpmY (do `web2tape https://url.whatever range`)
gollark: Here is a similar thing for JSON. Note that it delegates out to an external JSON library for string escaping.```luafunction safe_json_serialize(x, prev) local t = type(x) if t == "number" then if x ~= x or x <= -math.huge or x >= math.huge then return tostring(x) end return string.format("%.14g", x) elseif t == "string" then return json.encode(x) elseif t == "table" then prev = prev or {} local as_array = true local max = 0 for k in pairs(x) do if type(k) ~= "number" then as_array = false break end if k > max then max = k end end if as_array then for i = 1, max do if x[i] == nil then as_array = false break end end end if as_array then local res = {} for i, v in ipairs(x) do table.insert(res, safe_json_serialize(v)) end return "["..table.concat(res, ",").."]" else local res = {} for k, v in pairs(x) do table.insert(res, json.encode(tostring(k)) .. ":" .. safe_json_serialize(v)) end return "{"..table.concat(res, ",").."}" end elseif t == "boolean" then return tostring(x) elseif x == nil then return "null" else return json.encode(tostring(x)) endend```
gollark: My tape shuffler thing from a while ago got changed round a bit. Apparently there's some demand for it, so I've improved the metadata format and written some documentation for it, and made the encoder work better by using file metadata instead of filenames and running tasks in parallel so it's much faster. The slightly updated code and docs are here: https://pastebin.com/SPyr8jrh. There are also people working on alternative playback/encoding software for the format for some reason.

References

  1. "Liquibase Downloads". Liquibase. Retrieved 2020-05-29.
  2. https://www.liquibase.com/blog/2020-05-19
  3. "Liquibase Enterprise". Liquibase. Retrieved 2020-05-29.
  4. https://www.liquibase.com/forecast. Missing or empty |title= (help)
  5. "Liquibase Rules". Liquibase. Retrieved 2020-05-29.
  6. "Our partners". Liquibase. Retrieved 2020-05-29.
  7. "Liquibase Leadership". Liquibase. Retrieved 2020-05-29.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.