Liquibase® version 3.8.1 is now available! Get it for free.
2018 XML Announcement
News Liquibase 3.8.1 Released
06 Nov 2019

- and/or -

All Previous Posts >>

Change: ‘renameColumn’

Renames an existing column

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall3.0
columnDataTypeData type of the columnmariadb, mysqlall
newColumnNameName to rename the column toallall
oldColumnNameName of the existing column to renameallall
remarksRemarks of the columnall
schemaNameName of the schemaall
tableNameName of the table containing that the column to renameallall
<changeSet author="liquibase-docs"
        id="renameColumn-example"
        objectQuotingStrategy="LEGACY">
    <renameColumn catalogName="cat"
            columnDataType="int"
            newColumnName="full_name"
            oldColumnName="name"
            remarks="A String"
            schemaName="public"
            tableName="person"/>
</changeSet>
changeSet:
  id: renameColumn-example
  author: liquibase-docs
  objectQuotingStrategy: LEGACY
  changes:
  - renameColumn:
      catalogName: cat
      columnDataType: int
      newColumnName: full_name
      oldColumnName: name
      remarks: A String
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "renameColumn-example",
    "author": "liquibase-docs",
    "objectQuotingStrategy": "LEGACY",
    "changes": [
      {
        "renameColumn": {
          "catalogName": "cat",
          "columnDataType": "int",
          "newColumnName": "full_name",
          "oldColumnName": "name",
          "remarks": "A String",
          "schemaName": "public",
          "tableName": "person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person CHANGE name full_name INT COMMENT 'A String';

Database Support

DatabaseNotesAuto Rollback
DB2SupportedYes
DB2SupportedYes
DerbySupportedYes
FirebirdSupportedYes
H2SupportedYes
HyperSQLSupportedYes
INGRESSupportedYes
InformixSupportedYes
MariaDBSupportedYes
MySQLSupportedYes
OracleSupportedYes
PostgreSQLSupportedYes
SQL ServerSupportedYes
SQLiteNot SupportedYes
SybaseSupportedYes
Sybase AnywhereSupportedYes