Liquibase - list of available generic datatypes

According to Liquibase Column tag documentation:

To help make scripts database-independent, the following “generic” data types will be converted to the correct database implementation:

BOOLEAN
CURRENCY
UUID
CLOB
BLOB
DATE
DATETIME
TIME
BIGINT

Also, specifying a java.sql.Types.* type will be converted to the correct type as well. If needed, precision can be included. Here are some examples:

java.sql.Types.TIMESTAMP
java.sql.Types.VARCHAR(255)

These are the values in java.sql.Types:

public static final int BIT = -7;
public static final int TINYINT = -6;
public static final int SMALLINT = 5;
public static final int INTEGER = 4;
public static final int BIGINT = -5;
public static final int FLOAT = 6;
public static final int REAL = 7;
public static final int DOUBLE = 8;
public static final int NUMERIC = 2;
public static final int DECIMAL = 3;
public static final int CHAR = 1;
public static final int VARCHAR = 12;
public static final int LONGVARCHAR = -1;
public static final int DATE = 91;
public static final int TIME = 92;
public static final int TIMESTAMP = 93;
public static final int BINARY = -2;
public static final int VARBINARY = -3;
public static final int LONGVARBINARY = -4;
public static final int NULL = 0;
public static final int OTHER = 1111;
public static final int JAVA_OBJECT = 2000;
public static final int DISTINCT = 2001;
public static final int STRUCT = 2002;
public static final int ARRAY = 2003;
public static final int BLOB = 2004;
public static final int CLOB = 2005;
public static final int REF = 2006;
public static final int DATALINK = 70;
public static final int BOOLEAN = 16;
public static final int ROWID = -8;
public static final int NCHAR = -15;
public static final int NVARCHAR = -9;
public static final int LONGNVARCHAR = -16;
public static final int NCLOB = 2011;
public static final int SQLXML = 2009;
public static final int REF_CURSOR = 2012;
public static final int TIME_WITH_TIMEZONE = 2013;
public static final int TIMESTAMP_WITH_TIMEZONE = 2014;

Liquibase uses the standard JDBC datatypes - here is one reference, from http://db.apache.org/ojb/docu/guides/jdbc-types.html

DBC Type      Java Type
CHAR          String
VARCHAR       String
LONGVARCHAR   String
NUMERIC       java.math.BigDecimal
DECIMAL       java.math.BigDecimal
BIT           boolean
BOOLEAN       boolean
TINYINT       byte
SMALLINT      short
INTEGER       int
BIGINT        long
REAL          float
FLOAT         double
DOUBLE        double
BINARY        byte[]
VARBINARY     byte[]
LONGVARBINARY byte[]
DATE          java.sql.Date
TIME          java.sql.Time
TIMESTAMP     java.sql.Timestamp
CLOB          Clob
BLOB          Blob
ARRAY         Array
DISTINCT      mapping of underlying type
STRUCT        Struct
REF           Ref
DATALINK      java.net.URL
JAVA_OBJECT   underlying Java class

Tags:

Liquibase