Change: ‘renameTable’

Renames an existing table

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall
newTableNameNew name for the tableallall
oldTableNameName of the table to renameallall
schemaNameName of the schemaall
<changeSet author="liquibase-docs" id="renameTable-example">
    <renameTable catalogName="cat"
            newTableName="person"
            oldTableName="person"
            schemaName="public"/>
</changeSet>
changeSet:
  id: renameTable-example
  author: liquibase-docs
  changes:
  - renameTable:
      catalogName: cat
      newTableName: person
      oldTableName: person
      schemaName: public
{
  "changeSet": {
    "id": "renameTable-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "renameTable": {
          "catalogName": "cat",
          "newTableName": "person",
          "oldTableName": "person",
          "schemaName": "public"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person RENAME cat.person;

Database Support

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

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