Liquibase® version 3.8.5 is now available! Get it for free.
2018 XML Announcement
News All Previous Posts >>

Subscribe for email updates

- and/or -

Change: ‘modifyDataType’

Modify data type

Available Attributes

NameDescription
catalogNameName of the catalog@ v3.0E.g. 'cat'
columnNameName of the columnE.g. 'id'
newDataTypeE.g. 'int'
schemaNameName of the schemaE.g. 'public'
tableNameName of the tableE.g. 'person'
<changeSet author="liquibase-docs" id="modifyDataType-example">
    <modifyDataType catalogName="cat"
            columnName="id"
            newDataType="int"
            schemaName="public"
            tableName="person"/>
</changeSet>
changeSet:
  id: modifyDataType-example
  author: liquibase-docs
  changes:
  - modifyDataType:
      catalogName: cat
      columnName: id
      newDataType: int
      schemaName: public
      tableName: person
{
  "changeSet": {
    "id": "modifyDataType-example",
    "author": "liquibase-docs",
    "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
DB2/LUWSupportedNo
DB2/zNot SupportedNo
DerbySupportedNo
FirebirdSupportedNo
H2SupportedNo
HyperSQLSupportedNo
INGRESSupportedNo
InformixSupportedNo
MariaDBSupportedNo
MySQLSupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteNot SupportedNo
SybaseSupportedNo
Sybase AnywhereSupportedNo