Change: ‘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

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall3.0
columnNameName of the column to drop, if dropping a single columnall
schemaNameName of the schemaall
tableNameName of the table containing the column to dropallall

Nested Properties

NameDescriptionRequired ForSupportsMultiple AllowedSince
columnsColumns to be dropped if dropping multiple columns. If this is populated, the columnName attribute is ignored.

See the column tag documentation for more information
allyes
<changeSet author="liquibase-docs" id="dropColumn-example">
    <dropColumn catalogName="cat"
            columnName="id"
            schemaName="public"
            tableName="person">
        <column name="address" type="varchar(255)"/>
    </dropColumn>
</changeSet>
changeSet:
  id: dropColumn-example
  author: liquibase-docs
  changes:
  - dropColumn:
      catalogName: cat
      columnName: id
      columns:
      - column:
          name: address
          type: varchar(255)
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "dropColumn-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "dropColumn": {
          "catalogName": "cat",
          "columnName": "id",
          "columns": [
            {
              "column": {
                "name": "address",
                "type": "varchar(255)"
              }
            }]
          ,
          "schemaName": "public",
          "tableName": "person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person DROP COLUMN address;

Database Support

DatabaseNotesAuto Rollback
DB2/LUWSupportedNo
DB2/zNot SupportedNo
DerbySupportedNo
FirebirdSupportedNo
H2SupportedNo
HyperSQLSupportedNo
INGRESSupportedNo
InformixSupportedNo
MariaDBSupportedNo
MySQLSupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteSupportedNo
SybaseSupportedNo
Sybase AnywhereSupportedNo