Change: ‘dropPrimaryKey’

Drops an existing primary key

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall
constraintNameName of the primary keyfirebird, informix, sybaseall
dropIndexall
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"
            dropIndex="true"
            schemaName="public"
            tableName="person"/>
</changeSet>
changeSet:
  id: dropPrimaryKey-example
  author: liquibase-docs
  changes:
  - dropPrimaryKey:
      catalogName: cat
      constraintName: const_name
      dropIndex: true
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "dropPrimaryKey-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "dropPrimaryKey": {
          "catalogName": "cat",
          "constraintName": "const_name",
          "dropIndex": true,
          "schemaName": "public",
          "tableName": "person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person DROP PRIMARY KEY;

Database Support

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