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

Drops an existing unique constraint

Available Attributes

NameDescription
catalogNameName of the catalog@ v3.0E.g. 'cat'
constraintNameName of unique constraint to dropE.g. 'const_name'
schemaNameName of the schemaE.g. 'public'
tableNameName of the table to drop the unique constraint fromE.g. 'person'
uniqueColumnsE.g. 'name'
<changeSet author="liquibase-docs" id="dropUniqueConstraint-example">
    <dropUniqueConstraint catalogName="cat"
            constraintName="const_name"
            schemaName="public"
            tableName="person"
            uniqueColumns="name"/>
</changeSet>
changeSet:
  id: dropUniqueConstraint-example
  author: liquibase-docs
  changes:
  - dropUniqueConstraint:
      catalogName: cat
      constraintName: const_name
      schemaName: public
      tableName: person
      uniqueColumns: name
{
  "changeSet": {
    "id": "dropUniqueConstraint-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "dropUniqueConstraint": {
          "catalogName": "cat",
          "constraintName": "const_name",
          "schemaName": "public",
          "tableName": "person",
          "uniqueColumns": "name"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person DROP KEY const_name;

Database Support

DatabaseNotesAuto Rollback
DB2/LUWSupportedNo
DB2/zSupportedNo
DerbySupportedNo
FirebirdSupportedNo
H2SupportedNo
HyperSQLSupportedNo
INGRESSupportedNo
InformixSupportedNo
MariaDBSupportedNo
MySQLSupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteNot SupportedNo
SybaseSupportedNo
Sybase AnywhereSupportedNo