Skip to content

Grails Migration Plugin: wrong type mapping from grails dbm-generate-gorm-changelog #14771

Description

@ppazos

Expected Behavior

I have used grails dbm-generate-changelog after my tables were generated by hibernate, and a byte[] field with maxSize constraint of 1GB was generated as LONGBLOB.

Then dropped all tables, and used grails dbm-generate-gorm-changelog which generates the changelog from the domains classes. For the same byte[] field this generated a BLOB, so it's not considering the constraint of 1GB since a BLOB can by 65 KB long, when LONGBLOB is up to 4GB.

So there is something in the gorm command that is not processing constraints correctly or in the same way as Hibernate is doing when geneating the tables on the DB.

Actual Behaviour

Both grails dbm-generate-gorm-changelog and grails dbm-generate-changelog should generate the same column names, types and lengths.

Steps To Reproduce

Steps are above.

My domain class looks like this:

class DvMultimediaIndex {

   byte[] data

   static constraints = {
      data maxSize: 1073741824  // 1GB
   }
}

Environment Information

Linux Mint
| Grails Version: 5.3.3
| JVM Version: 11.0.20.1

Example Application

No response

Version

5.3.3 with database-migration:4.2.1 and liquibase-core:4.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions