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

Alter properties of an existing sequence

Available Attributes

NameDescription
cacheSizeintegerChange the cache size?E.g. '371717'
catalogNameName of the catalog@ v3.0E.g. 'cat'
cyclebooleanCan the sequence cycle when it hits the max value?
dataTypeData type of the sequenceSupported by: asany, db2z, derby, firebird, h2, informix, postgresqlE.g. 'int'
incrementByintegerNew amount the sequence should increment bySupported by: asany, db2, db2z, derby, firebird, informix, mssql, oracle, postgresqlE.g. '371717'
maxValueintegerNew maximum value for the sequenceSupported by: asany, db2, db2z, derby, firebird, h2, informix, mssql, oracle, postgresqlE.g. '371717'
minValueintegerNew minimum value for the sequenceE.g. '371717'
orderedbooleanDoes the sequence need to be guaranteed to be genererated inm the order of request?Supported by: asany, db2z, derby, firebird, h2, informix, mssql, oracle, postgresql
schemaNameName of the schemaE.g. 'public'
sequenceNameName of the sequence to alterE.g. 'seq_id'
<changeSet author="liquibase-docs" id="alterSequence-example">
    <alterSequence cacheSize="371717"
            catalogName="cat"
            cycle="true"
            dataType="int"
            incrementBy="371717"
            maxValue="371717"
            minValue="371717"
            ordered="true"
            schemaName="public"
            sequenceName="seq_id"/>
</changeSet>
changeSet:
  id: alterSequence-example
  author: liquibase-docs
  changes:
  - alterSequence:
      cacheSize: 371717
      catalogName: cat
      cycle: true
      dataType: int
      incrementBy: 371717
      maxValue: 371717
      minValue: 371717
      ordered: true
      schemaName: public
      sequenceName: seq_id
{
  "changeSet": {
    "id": "alterSequence-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "alterSequence": {
          "cacheSize": 371717,
          "catalogName": "cat",
          "cycle": true,
          "dataType": "int",
          "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 AS int INCREMENT BY 371717 MINVALUE 371717 MAXVALUE 371717 ORDER;

Database Support

DatabaseNotesAuto Rollback
DB2/LUWSupportedNo
DB2/zSupportedNo
DerbySupportedNo
FirebirdSupportedNo
H2SupportedNo
HyperSQLSupportedNo
INGRESNot SupportedNo
InformixSupportedNo
MariaDBNot SupportedNo
MySQLNot SupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteNot SupportedNo
SybaseNot SupportedNo
Sybase AnywhereSupportedNo