Liquibase® version 3.8.1 is now available! Get it for free.
2018 XML Announcement
News Liquibase 3.8.1 Released
06 Nov 2019

- and/or -

All Previous Posts >>

Change: ‘alterSequence’

Alter properties of an existing sequence

Available Attributes

NameDescriptionRequired ForSupportsSince
cacheSizeChange the cache size?all
catalogNameName of the catalogall3.0
cycleall
incrementByNew amount the sequence should increment byinformix, firebird, oracle, postgresql, db2, asany, db2z, derby, mssql
maxValueNew maximum value for the sequenceinformix, firebird, oracle, postgresql, db2, asany, db2z, derby, h2, mssql
minValueNew minimum value for the sequenceall
orderedDoes the sequence need to be guaranteed to be genererated inm the order of request?informix, firebird, oracle, postgresql, asany, db2z, derby, h2, mssql
schemaNameName of the schemaall
sequenceNameallall
<changeSet author="liquibase-docs"
        id="alterSequence-example"
        objectQuotingStrategy="LEGACY">
    <alterSequence cacheSize="371717"
            catalogName="cat"
            cycle="true"
            incrementBy="371717"
            maxValue="371717"
            minValue="371717"
            ordered="true"
            schemaName="public"
            sequenceName="seq_id"/>
</changeSet>
changeSet:
  id: alterSequence-example
  author: liquibase-docs
  objectQuotingStrategy: LEGACY
  changes:
  - alterSequence:
      cacheSize: 371717
      catalogName: cat
      cycle: true
      incrementBy: 371717
      maxValue: 371717
      minValue: 371717
      ordered: true
      schemaName: public
      sequenceName: seq_id
{
  "changeSet": {
    "id": "alterSequence-example",
    "author": "liquibase-docs",
    "objectQuotingStrategy": "LEGACY",
    "changes": [
      {
        "alterSequence": {
          "cacheSize": 371717,
          "catalogName": "cat",
          "cycle": true,
          "incrementBy": 371717,
          "maxValue": 371717,
          "minValue": 371717,
          "ordered": true,
          "schemaName": "public",
          "sequenceName": "seq_id"
        }
      }]
    
  }
}

SQL Generated From Above Sample (SQL Server)

ALTER SEQUENCE [public].seq_id INCREMENT BY 371717 MINVALUE 371717 MAXVALUE 371717 ORDER;

Database Support

DatabaseNotesAuto Rollback
DB2SupportedNo
DB2SupportedNo
DerbySupportedNo
FirebirdSupportedNo
H2SupportedNo
HyperSQLSupportedNo
INGRESNot SupportedNo
InformixSupportedNo
MariaDBNot SupportedNo
MySQLNot SupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteNot SupportedNo
SybaseNot SupportedNo
Sybase AnywhereSupportedNo