FAQ

What license is Liquibase released under?

Liquibase Open Source is released under the Apache License, version 2.0. Liquibase Secure is released under a commercial license. The main Liquibase jar file also contains commercially licensed Liquibase Secure code that is only active when a license key is provided.

Where can I get the source code?

The source is available from the main liquibase.org/download page or directly from Github.

How does Liquibase compare to tools that compare development database with production databases to generate change lists?

Liquibase works better because it understands what the changes are. For example, a database comparison program would simply see the "person" table on integration has a "firstname" and a "lastname" column, but on live, the "person" table has a "name" column. It would report that you need to drop the "name" column and add a "firstname" and a "lastname" column. While this would leave you with the correct schema, you would lose everyone's name in the process. With Liquibase, you would have a changeset that says "rename 'name' to 'lastname' and add a 'firstname' column" or, even better, "split the name column on a space and place the values in new 'firstname' and 'lastname' columns, then drop the ‘name' column." Knowing why they are different allows changes to production databases without the fear of losing valuable data.

What if multiple processes/application servers attempt to migrate the database at the same time?

Liquibase uses a distributed locking system to only allow one process to update the database at a time. The other processes will simply wait until the lock has been released.

Does Liquibase work with branches?

Yes. Since each change is independent, database changes that had been made in a different branch, then merged in will be run the next time Liquibase is run. You may run into a problem with the order that the statements are ran, but any issues you have can be easily solved by re-ordering the changelog files.

Can I use Liquibase to load data into our database?

Liquibase is designed to manage the structure and code. It’s great for concise data fixes and updates, but massive datasets are better handled with vendor-specific tooling or a purpose-built tool.

Nevertheless, when you add it to your changelog, you can use the loadData Change Type and load data from a CSV file into an existing table.

Why do I have to specify an "author" tag?

Why not just an "id" tag? The main reason for both the author the id attribute tag is because it is too easy for more than one person to a tag with the same "id" value–especially when using multiple branches. The source control system is going to resolve and merge two changesets added on different branches, but it won't care that there are two different changesets with the same "id", and once a changeset has been run against a database with one id, you can't (easily) change it. The chance of duplicates is lowered by determining changeset uniqueness based on an author tag.

What if I really don't want to specify an "author" tag?

There are times when an organization would not want to tie changes back to a particular individual or if the original author isn't actually known. If this is the case, make up a value such as "UNKNOWN."

How can I specify vendor-specific features, such as ENGINE=InnoDB, in MySQL?

We do not currently have a way to specify vendor-specific extensions to the create table tag, and so you would need to use the <sql> tag and specify your create table statement manually. Of course, you would be able to configure your mysql install to use innodb as the default storage engine with default-storage-engine=INNODB.

Since 1.9, the modifySql tag can be used to modify the generated SQL.

How can I automate file downloads for Liquibase?

Liquibase files, including the main application, drivers, and extensions, are all available via HTTP download, which means you can retrieve them using any method that supports HTTP - from a web browser for manual downloads to command-line tools for automation. The most common tools for scripting file downloads are curl and wget, which are available on most Unix-like systems and can be installed on Windows.

Example of downloading a JDBC driver with curl curl -L -o postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.7.3.jar

Example of downloading a JDBC driver with wget wget -O postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.7.3.jar

When building custom Docker images, you can script downloads directly in your Dockerfile rather than maintaining local copies of files. This ensures you always get the latest versions and reduces image repository size. For a complete guide on creating custom Liquibase Docker images, see Create a custom image with Docker.

What is all that stuff at the beginning of my XML changelog?

If you are using an XML format changelog, you may be wondering what all that stuff at the beginning is. Here's an example, followed by an explanation of each part.

XML format changelog example
    
<?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:secure="http://www.liquibase.org/xml/ns/secure"
    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/secure
        http://www.liquibase.org/xml/ns/secure/liquibase-secure-latest.xsd">
</databaseChangeLog>
FAQ - Liquibase