renameTable

Renames an existing table.

Available attributes

Name Description Required for Supports
Name Description Required for Supports
catalogName Name of the catalog all
newTableName New name for the table all all
oldTableName Name of the table to rename all all
schemaName Name of the schema all

XML example

<changeSet  author="liquibase-docs"  id="renameTable-example">  
    <renameTable  catalogName="cat"  
            newTableName="employee"  
            oldTableName="person"  
            schemaName="public"/>  
</changeSet>

YAML example

changeSet:  
  id:  renameTable-example  
  author:  liquibase-docs  
  changes:  
  -  renameTable:  
      catalogName:  cat  
      newTableName:  employee  
      oldTableName:  person  
      schemaName:  public

JSON example

{  "changeSet":  {  "id":  "renameTable-example",  "author":  "liquibase-docs",  "changes":  [  {  "renameTable":  {  "catalogName":  "cat",  "newTableName":  "employee",  "oldTableName":  "person",  "schemaName":  "public"  }  }]  }  }

SQL example

ALTER  TABLE  cat.person  RENAME  cat.employee;

Database support

Database Notes Auto rollback
DB2/LUW Supported Yes
DB2/z Supported Yes
Derby Supported Yes
Firebird Not Supported Yes
H2 Supported Yes
HyperSQL Supported Yes
INGRES Supported Yes
Informix Supported Yes
MariaDB Supported Yes
MySQL Supported Yes
Oracle Supported Yes
PostgreSQL Supported Yes
SQL Server Supported Yes
SQLite Supported Yes
Sybase Supported Yes
Sybase Anywhere Supported Yes