Liquibase Spatial

Liquibase Spatial is an extension to Liquibase to handle spatial indexing and geometry types. It requires Liquibase 3.1.1 or newer.

Liquibase Version Liquibase Spatial Version
Liquibase 3.1.1 Liquibase Spatial 1.0.x
Liquibase 3.2.x Liquibase Spatial 1.1.x
Liquibase 3.3.x Liquibase Spatial 1.2.x

In order to use this extension, you must have the liquibase-spatial jar in your classpath. For XML change logs, define the spatial namespace as below:

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

Using the XML elements defined by this extension requires specifying the spatial namespace prefix on those elements. Here is a quick example of how to create a table with a geometry column, create a spatial index on that column, and insert data into the table:

<changeSet id="Create table" author="bob">
      <spatial:spatialSupported />
   <createTable tableName="EXAMPLE">
      <column name="ID" type="BIGINT">
         <constraints nullable="false" primaryKey="true" primaryKeyName="EXAMPLE_PK" />
      <column name="GEOM" type="GEOMETRY(Point, 4326)">
         <constraints nullable="false" />

<changeSet id="Create spatial index" author="bob">
         <spatial:spatialIndexExists tableName="EXAMPLE" columnNames="GEOM" />
   <spatial:createSpatialIndex tableName="EXAMPLE" indexName="EXAMPLE_GEOM_IDX" geometryType="Point" srid="4326">
      <column name="GEOM" />

<changeSet id="Insert spatial data" author="bob">
   <insert tableName="EXAMPLE">
      <column name="ID" valueNumeric="1" />
      <column name="GEOM" value="SRID=4326;POINT(-5 -5)" />
   <insert tableName="EXAMPLE">
      <column name="ID" valueNumeric="2" />
      <column name="GEOM" value="SRID=4326;POINT(0 0)" />
   <insert tableName="EXAMPLE">
      <column name="ID" valueNumeric="3" />
      <column name="GEOM" value="SRID=4326;POINT(5 5)" />

Refer to the documentation for further information.