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

Renames an existing view

Available Attributes

NameDescription
catalogNameName of the catalog@ v3.0E.g. 'cat'
newViewNameName to rename the view toE.g. 'v_person'
oldViewNameName of the view to renameE.g. 'v_person'
schemaNameName of the schemaSupported by: ingres, mariadb, mssql, mysql, postgresql, sqlite, sybaseE.g. 'public'
<changeSet author="liquibase-docs" id="renameView-example">
    <renameView catalogName="cat"
            newViewName="v_person"
            oldViewName="v_person"
            schemaName="public"/>
</changeSet>
changeSet:
  id: renameView-example
  author: liquibase-docs
  changes:
  - renameView:
      catalogName: cat
      newViewName: v_person
      oldViewName: v_person
      schemaName: public
{
  "changeSet": {
    "id": "renameView-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "renameView": {
          "catalogName": "cat",
          "newViewName": "v_person",
          "oldViewName": "v_person",
          "schemaName": "public"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

RENAME TABLE cat.v_person TO cat.v_person;

Database Support

DatabaseNotesAuto Rollback
DB2/LUWNot SupportedYes
DB2/zNot SupportedYes
DerbyNot SupportedYes
FirebirdNot SupportedYes
H2Not SupportedYes
HyperSQLNot SupportedYes
INGRESSupportedYes
InformixNot SupportedYes
MariaDBSupportedYes
MySQLSupportedYes
OracleSupportedYes
PostgreSQLSupportedYes
SQL ServerSupportedYes
SQLiteSupportedYes
SybaseSupportedYes
Sybase AnywhereNot SupportedYes