Liquibase Data Type Handling
When you specify a data type in the type
field of a Change Type or tag, such as the <column type="XYZ">
field, Liquibase evaluates the type to send it to your database.
Liquibase implements many generic types natively. When necessary, Liquibase converts the data type you specify into a different type preferred by your database.
For example, if you specify the data type BOOLEAN
in your changelog, Liquibase passes it to a Snowflake database as a BOOLEAN
. However, on a PostgreSQL database, Liquibase converts it to a BIT
.
Type mapping matrix
The following table describes the logical mapping between data types in Liquibase:
- Each column is a generic type.
- Each row is a database supported by Liquibase.
- Each cell represents the database type Liquibase converts the generic type in that column to.
Platform | Database | ARRAY<INT>
|
ARRAY<STRING>
|
BIGINT
|
BINARY
|
BLOB
|
BOOLEAN
|
CHAR
|
CLOB
|
CURRENCY
|
DATE
|
DATETIME
|
DECIMAL
|
DOUBLE
|
FLOAT
|
INT
|
MEDIUMINT
|
NCHAR
|
NUMBER
|
NVARCHAR
|
SMALLINT
|
TEXT
|
TIME
|
TIMESTAMP
|
TIMESTAMP_NTZ
|
TINYINT
|
UUID
|
VARCHAR
|
XML
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Amazon DynamoDB | Amazon DynamoDB | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
IBM DB2 | IBM DB2 LUW | N/A | N/A | BIGINT
|
N/A | BINARY , BLOB , VARBINARY |
BOOLEAN , SMALLINT |
CHAR
|
CLOB
|
DECIMAL
|
DATE
|
TIMESTAMP
|
DECIMAL
|
DOUBLE
|
FLOAT
|
INTEGER
|
MEDIUMINT
|
NCHAR
|
NUMERIC
|
NVARCHAR
|
SMALLINT
|
N/A | TIME
|
TIMESTAMP
|
N/A | SMALLINT
|
CHAR
|
VARCHAR
|
XML
|
IBM DB2 zOS | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Databricks | Databricks | ARRAY<INT>
|
ARRAY<STRING>
|
BIGINT
|
N/A | BINARY
|
BOOLEAN
|
CHAR
|
CLOB
|
CURRENCY
|
DATE
|
TIMESTAMP
|
DECIMAL
|
DOUBLE
|
FLOAT
|
INT
|
MEDIUMINT
|
NCHAR
|
NUMBER
|
NVARCHAR
|
SMALLINT
|
N/A | TIME
|
TIMESTAMP
|
N/A | TINYINT
|
UUID
|
STRING
|
XML
|
Google BigQuery | Google BigQuery | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
MariaDB | MariaDB Server | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
MariaDB SkySQL | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
AWS RDS | N/A | N/A | BIGINT
|
N/A | BLOB
|
TINYINT(1)
|
CHAR
|
CLOB
|
DECIMAL
|
DATE
|
DATETIME
|
DECIMAL
|
DOUBLE
|
FLOAT
|
INT
|
MEDIUMINT
|
NCHAR
|
NUMBER
|
NVARCHAR
|
SMALLINT
|
N/A | TIME
|
TIMESTAMP
|
N/A | TINYINT
|
CHAR
|
VARCHAR
|
XML
|
|
Microsoft SQL Server | Microsoft SQL Server | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
AWS RDS | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Google Cloud SQL | N/A | N/A | BIGINT
|
N/A | BINARY , IMAGE , VARBINARY |
BIT
|
CHAR
|
NVARCHAR , VARCHAR |
MONEY , SMALLMONEY |
DATE
|
DATETIME , DATETIME2 |
DECIMAL
|
FLOAT
|
FLOAT , REAL |
INT
|
MEDIUMINT
|
NCHAR
|
NUMERIC
|
NVARCHAR
|
SMALLINT
|
N/A | TIME
|
DATETIME2 , TIMESTAMP |
N/A | TINYINT
|
UNIQUEIDENTIFIER
|
VARCHAR
|
TEXT , XML |
|
Microsoft Azure SQL Database | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Microsoft Azure SQL Managed Instance | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
MongoDB | MongoDB Atlas | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
MongoDB Community Server | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
MongoDB Enterprise Server | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
MySQL | MySQL Server | N/A | N/A | BIGINT
|
N/A | BINARY , BLOB , LONGBLOB , MEDIUMBLOB , TINYBLOB , VARBINARY |
BIT , TINYINT |
CHAR
|
LONGTEXT , MEDIUMTEXT , TEXT , TINYTEXT |
DECIMAL
|
DATE
|
DATETIME
|
DECIMAL
|
DOUBLE , DOUBLE PRECISION |
REAL
|
INT
|
MEDIUMINT
|
NCHAR
|
NUMERIC
|
NVARCHAR
|
SMALLINT
|
N/A | TIME
|
TIMESTAMP
|
N/A | TINYINT
|
CHAR
|
VARCHAR
|
LONGTEXT
|
AWS Aurora | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
AWS RDS | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Azure Database | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Google Cloud SQL | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Oracle | Oracle Database | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
Oracle Autonomous Database | N/A | N/A | NUMBER
|
N/A | BFILE , BLOB , RAW |
BOOLEAN , NUMBER |
CHAR
|
CLOB , NCLOB |
NUMBER
|
DATE
|
DATETIME , TIMESTAMP |
DECIMAL
|
DOUBLE PRECISION
|
FLOAT
|
INTEGER
|
MEDIUMINT
|
NCHAR
|
NUMBER
|
NVARCHAR2
|
NUMBER
|
N/A | DATE
|
TIMESTAMP
|
N/A | NUMBER
|
RAW
|
VARCHAR2
|
XMLTYPE
|
|
AWS RDS | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
PostgreSQL | PostgreSQL | N/A | N/A | N/A | N/A | N/A | |||||||||||||||||||||||
Amazon Redshift | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
AWS Aurora | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
AWS RDS | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Azure Database Flexible Server | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Azure Database Single Server | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
EnterpriseDB | N/A | N/A | N/A | N/A | N/A | ||||||||||||||||||||||||
Google Cloud SQL | N/A | N/A | BIGINT , BIGSERIAL |
N/A | BYTEA , OID |
BIT
|
CHARACTER
|
TEXT
|
DECIMAL
|
DATE
|
TIMESTAMP <param> WITH TIME ZONE , TIMESTAMP WITH TIME ZONE , TIMESTAMP WITHOUT TIME ZONE , TIMESTAMP <param> WITHOUT TIME ZONE |
DECIMAL
|
DOUBLE
|
REAL
|
INT , INTEGER , SERIAL |
MEDIUMINT
|
NCHAR
|
NUMERIC
|
VARCHAR
|
SMALLINT , SMALLSERIAL |
N/A | TIME
|
TIMESTAMP
|
N/A | SMALLINT
|
CHAR
|
CHARACTER
|
TEXT , XML |
|
Snowflake | Snowflake | N/A | N/A | BIGINT
|
BINARY , VARBINARY |
BLOB
|
BOOLEAN
|
CHAR
|
VARCHAR
|
DECIMAL
|
DATE
|
DATETIME
|
DECIMAL
|
FLOAT
|
FLOAT
|
INT
|
MEDIUMINT
|
NCHAR
|
NUMBER
|
NVARCHAR
|
SMALLINT
|
TEXT
|
TIME
|
TIMESTAMP
|
TIMESTAMP_NTZ
|
TINYINT
|
CHAR
|
VARCHAR
|
XML
|