kaleidos / grails-postgresql-extensions

Grails plugin to use postgresql native elements such as arrays, hstores,...
Apache License 2.0
78 stars 62 forks source link

Does not work with Grails Migration Plugin #8

Closed mattfeury closed 11 years ago

mattfeury commented 11 years ago

Hello!

I'm trying to put this in my app that uses the Grails Migration Plugin (https://github.com/grails-plugins/grails-database-migration). Whenever I add the type: IntegerArrayType mapping to a domain class, then the dbm-gorm-diff fails to spit out any diff. There is the possibility something funky is going on on my end, but I was wondering if this is an issue for anyone else?

If I take out the mapping from the domain class and run grails dbm-gorm-diff, I get a valid diff. But once I put the type restriction in, it fails to spit any diff out. It'd be great to have migration support for these types.

thanks!

mattfeury commented 11 years ago

seems to work if I add an sqlType actually:

    static mapping = {
        fieldName sqlType: "int[]", type: IntegerArrayType
    }

not sure if this is expected or not, so i'll leave this open until I hear otherwise

ilopmar commented 11 years ago

Hello,

I'm using the plugin and it's working with grails db-migration plugin. Do you have defined the dialect in the DataSource.groovyfile?

development {
    dataSource {
        dbCreate = ""
        driverClassName = "org.postgresql.Driver"
        dialect = "net.kaleidos.hibernate.PostgresqlExtensionsDialect"
        url = "jdbc:postgresql://localhost:5432/db-name"
        username = "user"
        password = "password"
    }
}

Regards, Iván.

mattfeury commented 11 years ago

ah, I was using the wrong environment's dataSource. seems to be working now! thanks!

ilopmar commented 11 years ago

Great :-)