Database migration plugin issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Database migration plugin issue

Colin Harrington
I have an issue where the dbm-gorm-diff script isn't generating changesets for my maxSize constraint changes:

I originally did not have any constraints on this column when I generated my baseline (and accepted the default varchar(255) that it generated)
class MyDomain {
    ...
    String message

    static constraints = {
        ... nothing for message ...
    }
}
After I updated the constraints:
class MyDomain {
    ...
    String message

    static constraints = {
        ...   
        message(nullable:true, maxSize: 1024)   
    }
}
and executed
grails dbm-gorm-diff UpdateMyDomainMessageConstraints.groovy --add

There were no changesets for the table modifications in my UpdateMyDomainMessageConstraints.groovy file.

Is this a known issue? 

Where should I look in order to debug and possibly fix this issue?

Colin Harrington
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Database migration plugin issue

burtbeckwith
The primary class for gorm-diff is GormDatabaseSnapshotGenerator. It takes the in-memory Hibernate tables, columns, etc. and converts them into analagous Liquibase classes. This line would appear to be the culprit:

   column.columnSize = column.numeric ? hibernateColumn.precision : hibernateColumn.length

Burt

> I have an issue where the dbm-gorm-diff script isn't generating changesets
> for my maxSize constraint changes:
>
> I originally did not have any constraints on this column when I generated my
> baseline (and accepted the default varchar(255) that it generated)
> class MyDomain {
>     ...
>     String message
>
>     static constraints = {
>         ... nothing for message ...
>     }
> }
> After I updated the constraints:
> class MyDomain {
>     ...
>     String message
>
>     static constraints = {
>         ...
>         *message(nullable:true, maxSize: 1024)*
>     }
> }
> and executed
> grails dbm-gorm-diff UpdateMyDomainMessageConstraints.groovy --add
>
> There were no changesets for the table modifications in my
> UpdateMyDomainMessageConstraints.groovy file.
>
> Is this a known issue?
>
> Where should I look in order to debug and possibly fix this issue?
>
> Colin Harrington
> [hidden email]
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email