Using Liquibase with VoltDB

Image of Julius Krah Written by: Pavan Mulani

The purpose of this document is to guide you through the process of creating a new Liquibase project for VoltDB. In this tutorial, you will learn how to install the required database drivers and configure the Liquibase properties file to establish a database connection to VoltDB.

Support for VoltDB is provided via a Liquibase extension. The extension provides basic database operations including:

  • DML statements
  • DDL statements


Before using Liquibase with your database, ensure you have:


To configure a Liquibase project for VoltDB, perform the following steps:

  1. Install the JDBC driver.

If you place the JDBC driver in the liquibase/lib install directory, it is loaded automatically when running Liquibase commands. Also, you can use another directory and add the location to the classpath in the Liquibase properties file.

  1. Install the Liquibase extension.

Copy the extension jar file into the $LIQUIBASE_HOME/lib directory.

  1. Create a project folder.

The project folder will be used to store the Liquibase configuration files and changelogs.

  1. Add the following properties to the Liquibase properties file:
changelog-file: dbchangelog.xml 
url: jdbc:voltdb:// 
username: voltdb 
password: voltdb 
driver: org.voltdb.jdbc.Driver 
classpath: ../../Liquibase_Drivers/jdbcdriver.jar

Note: Liquibase supports only the following special characters: ~ # $ % * ( ) - _ + [ ] { } . ?. Unsupported special characters are as follows: @ & / : < > " ' ` | ^ ! = , \ <spaces>.

Use the following format for the url property:

  • If you placed the jdbc driver file in the liquibase/lib install directory, do not specify the classpath property in the Liquibase properties file. Otherwise, specify the driver path as shown in the preceding example.
  • To apply a Liquibase Pro key to your project, add the following property to the Liquibase properties file:
liquibaseProLicenseKey: <paste license key>
  1. Create a dbchangelog.xml file in the project folder.

Add a changeset to the changelog. The changesets are uniquely identified by author and id. Liquibase attempts to execute each changeset in a transaction that is committed at the end. In the dbchangelog.xml file, add a new department create table changeset as follows:

<?xml version="1.0" encoding="UTF-8"?>
<createTable  tableName="person">
      <column  name="id"  type="int"  autoIncrement="true">
            <constraints  primaryKey="true"  nullable="false"/>
      <column  name="firstname"  type="varchar(50)"/>
      <column  name="lastname"  type="varchar(50)">
            <constraints  nullable="false"/>

<changeSet author="authorname" id="insert-example"> 
      <insert tableName="person">
      <column name="id" value="1"/>
      <column name="firstname" value="Bob"/>
      <column  name="lastname"  value="Builder" />
  1. Generate and execute SQL

Open the command prompt, navigate to the project directory, and then run the following command to get the SQL output of the changelogs:

liquibase update-sql

To execute the changeset in your schema, run the following:

liquibase update
  1. Verify that the tables have been created

From a database UI Tool, check your database changes. You will see a new person and table added to the database. For example:


Also, you will see two more tables:

DATABASECHANGELOG table. This table keeps a record of all the changesets that were deployed. This way, when you deploy again, the changesets in the changelog will be compared with the DATABASECHANGELOG tracking table, and only the new changesets that were not found in the DATABASECHANGELOG will be deployed. You will see that a new row was created in that table with the changeset information you have just deployed. For example:

DATABASECHANGELOGLOCK table. This table is used internally by Liquibase to manage access to the changelog table during deployment.


You have successfully configured your project and can begin creating changesets to migrate changes to your database. For more information on how to create changesets, see Changelog Formats.

See also