grails-core icon indicating copy to clipboard operation
grails-core copied to clipboard

Creating non-unique index in domain class create a unique and non-unique index

Open runwolf opened this issue 10 years ago • 2 comments

With grails 3.0.14 and mysql

Create a class like this

class Toto {
    static constraints = {
    }
    static mapping = {
        tata index:'tata_Idx', unique: 'false'
    }
    String tata
}

run grails and you will get two index in the database:

  • tata_Idx ->INDEX
  • UK_39dh1wvr5dfsp8bqsk9naxebp -> UNIQUE

runwolf avatar Feb 11 '16 21:02 runwolf

Shouldn't unique: 'false' be unique: false? a String is not a boolean

graemerocher avatar Feb 12 '16 07:02 graemerocher

Boolean works ! I cannot really tell when, but it use to work as a String :-)

thanks guys !

runwolf avatar Feb 14 '16 14:02 runwolf