Change: ‘renameColumn’

Renames an existing column

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall3.0
columnDataTypeData type of the columnmysqlall
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">
    <renameColumn catalogName="cat"
            columnDataType="int"
            newColumnName="id"
            oldColumnName="id"
            remarks="A String"
            schemaName="public"
            tableName="person"/>
</changeSet>
changeSet:
  id: renameColumn-example
  author: liquibase-docs
  changes:
  - renameColumn:
      catalogName: cat
      columnDataType: int
      newColumnName: id
      oldColumnName: id
      remarks: A String
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "renameColumn-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "renameColumn": {
          "catalogName": "cat",
          "columnDataType": "int",
          "newColumnName": "id",
          "oldColumnName": "id",
          "remarks": "A String",
          "schemaName": "public",
          "tableName": "person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

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

Database Support

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

Missing, incomplete or wrong information? Please send a pull request