Closed ErwinvanBrandwijk closed 13 years ago
Possible solution in my fork. Renamed it to modifyDataType, because you are only changing dataType import liquibase.change.core.ModifyDataTypeChange
void modifyDataType(Map params) {
addMapBasedChange(ModifyDataTypeChange, params, ['schemaName', 'tableName', 'columnName', 'newDataType'])
}
changelog changeSet(author: "erwin", id: "5") { modifyDataType(tableName: "books4", columnName: "author", newDataType: "varchar(40)")
rollback{
modifyDataType(tableName: "books4", columnName: "author", newDataType: "varchar(50)")
}
}
Result
mysql> DESCRIBE books4;
Field | Type | Null | Key | Default
id | bigint(20) | NO | PRI | NULL
title | varchar(50) | YES | | NULL
author | varchar(40) | YES | | NULL
mysql> DESCRIBE books4;
Field | Type | Null | Key | Default
id | bigint(20) | NO | PRI | NULL
title | varchar(50) | YES | | NULL
author | varchar(50) | YES | | NULL
Accepted in master
Not yet created
Now listed as modifyColumn. Isn't modifyDataType?