公式リファレンスではドメインクラスでカラムのindexを作成できるはずなのだが、、
5.5.2.6 Database Indices
class Person {
String firstName
String address
static mapping = {
table 'people'
version false
id column:'person_id'
firstName column:'First_Name', index:'Name_Idx'
address column:'Address', index:'Name_Idx,Address_Index'
}
}
う〜ん。本番環境に最初にデプロイしたときはcreateでDBにつなげて、それ以降のデプロイはupdateにすれば良いのかな。あとからindexの追加がしたければ手動でやるしかない。