The createTable Change Type creates a table.


You can typically use the createTable Change Type when you want to create a table in your changelog file and then deploy it to your database. It can include columns and another values listed in this documentation.

Running the createTable Change Type

To create a table for your database, follow these steps:

Step 1: Add the createTable Change Type to your changeset with the needed attributes as it is shown in the examples.

Step 2: Deploy your changeset by running the update command.

liquibase update

Now, you should see a new table.

Available attributes

Name Description Required for Supports
catalogName Name of the catalog all
remarks Comments stored for the table all
schemaName Name of the schema all
tableName Name of the table all all
tablespace Name of the tablespace, the table created in all

Nested properties

Name Description Required for Supports Multiple allowed
columns Column definitions

all all yes

XML example

<changeSet  author="liquibase-docs"  id="createTable-example">  
    <createTable  catalogName="cat"  
            remarks="A String"  
            tablespace="A String">  
        <column  name="address"  type="varchar(255)"/>  

YAML example

  id:  createTable-example  
  author:  liquibase-docs  
  -  createTable:  
      catalogName:  cat  
      -  column:  
          name:  address  
          type:  varchar(255)  
      remarks:  A String  
      schemaName:  public  
      tableName:  person  
      tablespace:  A String

JSON example

"changeSet": {
  "id": "createTable-example",
  "author": "liquibase-docs",
  "changes": [
	 "createTable": {
	 "catalogName": "cat",
	 "columns": [
	  "column": {
		"name": "address",
		"type": "varchar(255)"
	     "remarks": "A String",
         "schemaName": "public",
	     "tableName": "person",
	     "tablespace": "A String"

SQL example

CREATE  TABLE  cat.person  (address  VARCHAR(255)  NULL)  COMMENT='A String';  

ALTER  TABLE  cat.person  COMMENT  =  'A String';

Database support

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