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

Modify data type

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall3.0
columnNameName of the columnallall
newDataTypeallall
schemaNameName of the schemaall
tableNameName of the tableallall
<changeSet author="liquibase-docs"
        id="modifyDataType-example"
        objectQuotingStrategy="LEGACY">
    <modifyDataType catalogName="cat"
            columnName="id"
            newDataType="int"
            schemaName="public"
            tableName="person"/>
</changeSet>
changeSet:
  id: modifyDataType-example
  author: liquibase-docs
  objectQuotingStrategy: LEGACY
  changes:
  - modifyDataType:
      catalogName: cat
      columnName: id
      newDataType: int
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "modifyDataType-example",
    "author": "liquibase-docs",
    "objectQuotingStrategy": "LEGACY",
    "changes": [
      {
        "modifyDataType": {
          "catalogName": "cat",
          "columnName": "id",
          "newDataType": "int",
          "schemaName": "public",
          "tableName": "person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

ALTER TABLE cat.person MODIFY id INT;

Database Support

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