Change: ‘dropPrimaryKey’

Drops an existing primary key

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall
constraintNameName of the primary keyinformix, firebirdall
schemaNameName of the schemaall
tableNameName of the table to drop the primary key ofallall
<changeSet author="liquibase-docs" id="dropPrimaryKey-example">
    <dropPrimaryKey catalogName="cat"
            constraintName="const_name"
            schemaName="public"
            tableName="person"/>
</changeSet>
changeSet:
  id: dropPrimaryKey-example
  author: liquibase-docs
  changes:
  - dropPrimaryKey:
      catalogName: cat
      constraintName: const_name
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "dropPrimaryKey-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "dropPrimaryKey": {
          "catalogName": "cat",
          "constraintName": "const_name",
          "schemaName": "public",
          "tableName": "person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person DROP PRIMARY KEY;

Database Support

DatabaseNotesAuto Rollback
DB2SupportedNo
DerbySupportedNo
FirebirdSupportedNo
H2SupportedNo
HyperSQLSupportedNo
InformixSupportedNo
MySQLSupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteSupportedNo
SybaseSupportedNo
Sybase AnywhereSupportedNo

Missing, incomplete or wrong information? Please send a pull request