Liquibase® version 3.8.5 is now available! Get it for free.
2018 XML Announcement
News All Previous Posts >>

Subscribe for email updates

- and/or -

Change: ‘renameColumn’

Renames an existing column

Available Attributes

NameDescription
catalogNameName of the catalog@ v3.0E.g. 'cat'
columnDataTypeData type of the columnE.g. 'int'Required for: mariadb, mysql
newColumnNameName to rename the column toE.g. 'full_name'
oldColumnNameName of the existing column to renameE.g. 'name'
remarksRemarks of the columnE.g. 'A String'
schemaNameName of the schemaE.g. 'public'
tableNameName of the table containing that the column to renameE.g. 'person'
<changeSet author="liquibase-docs" id="renameColumn-example">
    <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
  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",
    "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
DB2/LUWSupportedYes
DB2/zSupportedYes
DerbySupportedYes
FirebirdSupportedYes
H2SupportedYes
HyperSQLSupportedYes
INGRESSupportedYes
InformixSupportedYes
MariaDBSupportedYes
MySQLSupportedYes
OracleSupportedYes
PostgreSQLSupportedYes
SQL ServerSupportedYes
SQLiteNot SupportedYes
SybaseSupportedYes
Sybase AnywhereSupportedYes