Create Table
| Name | Description |
|---|---|
| catalogName | Name of the catalog@ v3.0E.g. 'cat' |
| remarks | Comments stored for the tableE.g. 'A String' |
| schemaName | Name of the schemaE.g. 'public' |
| tableName | Name of the tableE.g. 'person' |
| tablespace | Name of the tablespace, the table created inE.g. 'A String' |
| Name | Description |
|---|---|
| columns / column [1..N] | Column definitionsNote: columns tag not required in XML See the column tag documentation for more information |
<changeSet author="liquibase-docs" id="createTable-example">
<createTable catalogName="cat"
remarks="A String"
schemaName="public"
tableName="person"
tablespace="A String">
<column name="id" type="int">
<constraints nullable="false"/>
</column>
<column name="address" type="varchar(50)"/>
</createTable>
</changeSet>changeSet:
id: createTable-example
author: liquibase-docs
changes:
- createTable:
catalogName: cat
columns:
- column:
constraints:
nullable: false
name: id
type: int
- column:
name: address
type: varchar(50)
remarks: A String
schemaName: public
tableName: person
tablespace: A String{
"changeSet": {
"id": "createTable-example",
"author": "liquibase-docs",
"changes": [
{
"createTable": {
"catalogName": "cat",
"columns": [
{
"column": {
"constraints": {
"nullable": false
},
"name": "id",
"type": "int"
}
},
{
"column": {
"name": "address",
"type": "varchar(50)"
}
}]
,
"remarks": "A String",
"schemaName": "public",
"tableName": "person",
"tablespace": "A String"
}
}]
}
}CREATE TABLE cat.person (id INT NOT NULL,
address VARCHAR(50) NULL) COMMENT='A String';
ALTER TABLE cat.person COMMENT = 'A String';| 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 |