addLookupTable

Creates a lookup table containing values stored in a column and creates a foreign key to the new table.

Available attributes

Name Description Required for Supports
constraintName Name of the constraint (FOREIGN KEY CONSTRAINT) to create between the existing table and the lookup table all
existingColumnName Name of the column containing the data to extract all all
existingTableCatalogName Name of the catalog of the existing table all
existingTableName Name of the table containing the data to extract all all
existingTableSchemaName Name of the schema of the existing table all
newColumnDataType

Data type of the column.

To help make scripts database-independent, Liquibase automatically converts the following generic data types to the correct database implementation: BIGINT, BLOB, BOOLEAN, CHAR, CLOB, CURRENCY, DATE, DATETIME, DECIMAL, DOUBLE, FLOAT, INT, MEDIUMINT, NCHAR, NUMBER, NVARCHAR, SMALLINT, TIME, TIMESTAMP, TINYINT, UUID, VARCHAR, XML.

Also, specifying a java.sql.Types.* type is converted to the correct type as well. For example:

  • java.sql.Types.TIMESTAMP
  • java.sql.Types.VARCHAR(255)
informix, mariadb, mssql, mysql all
newColumnName Name of the column in the new table to create all all
newTableCatalogName Name of the catalog of the table to create all
newTableName Name of the table to create all all
newTableSchemaName Name of the schema of the table to create all

Database support

Database Notes Auto Rollback
DB2/LUW Supported Yes
DB2/z Supported Yes
Derby Supported Yes
Firebird Not Supported No
H2 Supported Yes
HyperSQL Not Supported No
INGRES Supported Yes
Informix Supported Yes
MariaDB Supported Yes
MySQL Supported Yes
Oracle Supported Yes
PostgreSQL Supported Yes
Snowflake Supported Yes
SQL Server Supported Yes
SQLite Not Supported No
Sybase Supported Yes
Sybase Anywhere Supported Yes