How to change a column using the Grails Groovy DSL database migration module?

Can you give an example of a groovy change set with a method modifyDataType?

I tried this:

databaseChangeLog = {
  changeSet(author: "user", id: "5-1") {
        modifyDataType(tableName: "test", columnName: "description4", newDataType: "int(11)")
    }
}

But modifyDataTypenot recognized. I also tried modifyColumn, but get the same result.

The main question is: which tags support dsl and how are they used?

+5
source share
2 answers

Liquibase - DSL Groovy XML Liquibase. modDataType, script, - . https://github.com/grails-plugins/grails-database-migration/blob/master/testapp/price.changelog.groovy

, , , .

+9

:

databaseChangeLog = {

  changeSet(author: "test (generated)", id: "1422541392309-2") {
    comment { 'Rename tabTitle to tabName' }
    renameColumn(tableName: "user", oldColumnName: "tab_title", newColumnName: "tab_name", columnDataType: "varchar(255)")
  }
}
0

All Articles