Skip to content

Instantly share code, notes, and snippets.

@sagrawal31
Last active October 29, 2020 12:16
Show Gist options
  • Select an option

  • Save sagrawal31/b71446751f4ea3fa040832e1c9a032ae to your computer and use it in GitHub Desktop.

Select an option

Save sagrawal31/b71446751f4ea3fa040832e1c9a032ae to your computer and use it in GitHub Desktop.
databaseChangeLog = {
changeSet(author: 'Shashank', id: 'post.description.051020123') {
comment { 'increase description to 1400 chars' }
modifyDataType(tableName: 'post', columnName: 'description',
newDataType: 'varchar(1400)')
// Altering the column removes the not null property (makes it nullable) if your column was non-nullable.
// To fix this, you can pass "NOT NULL" to newDataType attribute as given below
// https://stackoverflow.com/questions/35864845/liquibase-modifydatatype-tag-always-makes-the-column-nullable
modifyDataType(tableName: 'post', columnName: 'description',
newDataType: 'varchar(1400) NOT NULL')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment