Liquibase® version 3.8.1 is now available! Get it for free.
2018 XML Announcement

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"
        objectQuotingStrategy="LEGACY">
    <renameTable catalogName="cat"
            newTableName="employee"
            oldTableName="person"
            schemaName="public"/>
</changeSet>
changeSet:
  id: renameTable-example
  author: liquibase-docs
  objectQuotingStrategy: LEGACY
  changes:
  - renameTable:
      catalogName: cat
      newTableName: employee
      oldTableName: person
      schemaName: public
{
  "changeSet": {
    "id": "renameTable-example",
    "author": "liquibase-docs",
    "objectQuotingStrategy": "LEGACY",
    "changes": [
      {
        "renameTable": {
          "catalogName": "cat",
          "newTableName": "employee",
          "oldTableName": "person",
          "schemaName": "public"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person RENAME cat.employee;

Database Support

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