Renames an existing table
Name | Description |
---|---|
catalogName | Name of the catalogE.g. 'cat' |
newTableName | New name for the tableE.g. 'employee' |
oldTableName | Name of the table to renameE.g. 'person' |
schemaName | Name 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"
}
}]
}
}
ALTER TABLE cat.person RENAME cat.employee;
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 |