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

Deletes data from an existing table

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall
schemaNameName of the schemaall
tableNameName of the tableallall
whereall
<changeSet author="liquibase-docs"
        id="delete-example"
        objectQuotingStrategy="LEGACY">
    <delete catalogName="cat"
            schemaName="public"
            tableName="person">
        <where>name='Bob'</where>
    </delete>
</changeSet>
changeSet:
  id: delete-example
  author: liquibase-docs
  objectQuotingStrategy: LEGACY
  changes:
  - delete:
      catalogName: cat
      schemaName: public
      tableName: person
      where: name='Bob'
{
  "changeSet": {
    "id": "delete-example",
    "author": "liquibase-docs",
    "objectQuotingStrategy": "LEGACY",
    "changes": [
      {
        "delete": {
          "catalogName": "cat",
          "schemaName": "public",
          "tableName": "person",
          "where": "name='Bob'"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

DELETE FROM cat.person WHERE name='Bob';

Database Support

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