Liquibase® version 3.8.2 is now available! Get it for free.
2018 XML Announcement
News 5 Ways to Fix a Bad Database Change in Liquibase
04 Dec 2019

- and/or -

All Previous Posts >>

Change: ‘renameSequence’

Renames an existing sequence

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall3.0
newSequenceNameNew name for the sequenceallall
oldSequenceNameName of the sequence to renameallall
schemaNameName of the schemaall
<changeSet author="liquibase-docs" id="renameSequence-example">
    <renameSequence catalogName="cat"
            newSequenceName="seq_id"
            oldSequenceName="seq_id"
            schemaName="public"/>
</changeSet>
changeSet:
  id: renameSequence-example
  author: liquibase-docs
  changes:
  - renameSequence:
      catalogName: cat
      newSequenceName: seq_id
      oldSequenceName: seq_id
      schemaName: public
{
  "changeSet": {
    "id": "renameSequence-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "renameSequence": {
          "catalogName": "cat",
          "newSequenceName": "seq_id",
          "oldSequenceName": "seq_id",
          "schemaName": "public"
        }
      }]
    
  }
}

SQL Generated From Above Sample (SQL Server)

SP_RENAME seq_id ,
seq_id;

Database Support

DatabaseNotesAuto Rollback
DB2Not SupportedYes
DB2Not SupportedYes
DerbySupportedYes
FirebirdNot SupportedYes
H2Not SupportedYes
HyperSQLNot SupportedYes
INGRESNot SupportedYes
InformixNot SupportedYes
MariaDBNot SupportedYes
MySQLNot SupportedYes
OracleSupportedYes
PostgreSQLSupportedYes
SQL ServerSupportedYes
SQLiteNot SupportedYes
SybaseNot SupportedYes
Sybase AnywhereSupportedYes