Announcements

Change: ‘update’

Updates data in an existing table

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall
schemaNameName of the schemaall
tableNameName of the tableallall
whereall

Nested Properties

NameDescriptionRequired ForSupportsMultiple AllowedSince
columnsData to update

See the column tag documentation for more information
allallyes
<changeSet author="liquibase-docs" id="update-example">
    <update catalogName="cat"
            schemaName="public"
            tableName="person">
        <column name="address" type="varchar(255)"/>
        <where>A String</where>
    </update>
</changeSet>
changeSet:
  id: update-example
  author: liquibase-docs
  changes:
  - update:
      catalogName: cat
      columns:
      - column:
          name: address
          type: varchar(255)
      schemaName: public
      tableName: person
      where: A String
{
  "changeSet": {
    "id": "update-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "update": {
          "catalogName": "cat",
          "columns": [
            {
              "column": {
                "name": "address",
                "type": "varchar(255)"
              }
            }]
          ,
          "schemaName": "public",
          "tableName": "person",
          "where": "A String"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

UPDATE cat.person SET address = NULL WHERE A String;

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