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: ‘renameTable’

Renames an existing table

Available Attributes

NameDescription
catalogNameName of the catalogE.g. 'cat'
newTableNameNew name for the tableE.g. 'employee'
oldTableNameName of the table to renameE.g. 'person'
schemaNameName of the schemaE.g. 'public'
<changeSet author="liquibase-docs" id="renameTable-example">
    <renameTable catalogName="cat"
            newTableName="employee"
            oldTableName="person"
            schemaName="public"/>
</changeSet>
changeSet:
  id: renameTable-example
  author: liquibase-docs
  changes:
  - renameTable:
      catalogName: cat
      newTableName: employee
      oldTableName: person
      schemaName: public
{
  "changeSet": {
    "id": "renameTable-example",
    "author": "liquibase-docs",
    "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
DB2/LUWSupportedYes
DB2/zSupportedYes
DerbySupportedYes
FirebirdNot SupportedYes
H2SupportedYes
HyperSQLSupportedYes
INGRESSupportedYes
InformixSupportedYes
MariaDBSupportedYes
MySQLSupportedYes
OracleSupportedYes
PostgreSQLSupportedYes
SQL ServerSupportedYes
SQLiteSupportedYes
SybaseSupportedYes
Sybase AnywhereSupportedYes