dropColumn

Drop existing column(s).

To drop a single column, use the simple form of this element where the tableName and columnName are specified as attributes. To drop several columns, specify the tableName as an attribute, and then specify a set of nested <column> tags. If nested <column> tags are present, the columnName attribute will be ignored.

Available attributes

Name Description Required for Supports Since
catalogName Name of the catalog all 3.0
columnName Name of the column to drop, if dropping a single column. Ignored if nested 'column's are defined all
schemaName Name of the schema all
tableName Name of the table containing the column(s) to drop all all

Nested properties

Name Description Required for Supports Multiple allowed
columns Columns to be dropped if dropping multiple columns. If this is populated, the columnName attribute is ignored.

See the Column tag documentation for more information
all yes

XML example

<changeSet  author="liquibase-docs"  id="dropColumn-example">  
    <dropColumn  catalogName="cat"  
            columnName="id"  
            schemaName="public"  
            tableName="person">  
        <column  name="address"/>  
    </dropColumn>  
</changeSet>

YAML example

changeSet:  
  id:  dropColumn-example  
  author:  liquibase-docs  
  changes:  
  -  dropColumn:  
      catalogName:  cat  
      columnName:  id  
      columns:  
      -  column:  
          name:  address  
      schemaName:  public  
      tableName:  person

JSON example

{  "changeSet":  {  "id":  "dropColumn-example",  "author":  "liquibase-docs",  "changes":  [  {  "dropColumn":  {  "catalogName":  "cat",  "columnName":  "id",  "columns":  [  {  "column":  {  "name":  "address"  }  }]  ,  "schemaName":  "public",  "tableName":  "person"  }  }]  }  }

SQL example

ALTER  TABLE  cat.person  DROP  COLUMN  address;

Database support

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