Adding index key in Grails' Domain
Posted
by firnnauriel
on Stack Overflow
See other posts from Stack Overflow
or by firnnauriel
Published on 2010-05-04T06:38:50Z
Indexed on
2010/05/04
8:18 UTC
Read the original article
Hit count: 168
I tried following this reference and this is now my domain's code:
class SnbrActVector {
long nid
String term
double weight
static mapping = {
version false
nid index:'Nid_Idx'
}
static constraints = {
term(blank:false)
}
}
What I want is to do is to add an index key for 'nid' column. I dropped the existing table and run the app again so the table is then recreated. However, when i check for list of indices, I can't see a 'Nid_Idx', only available is 'PRIMARY'. Do I have to manually create the index and name it 'Nid_idx in my mysql database?
Thanks.
© Stack Overflow or respective owner