protoc-gen-gorm
protoc-gen-gorm copied to clipboard
index tag should be a repeated field
gorm supports repeating index
to create multiple indexes involving same column.
https://gorm.io/docs/indexes.html#Multiple-indexes
It looks like this can be somehow worked around by doing this:
message Incident {
/*required*/ google.protobuf.Timestamp created_time = 6 [
(gorm.field).tag = {index: "incident_idx1,priority:3;index:incident_idx2,priorty:3"}
];
}
This works because it will concatenate into this: "index:incident_idx1,priority:3;index:incident_idx2,priorty:3;"
, which is what we want.
But this is ugly hack that is not documented, and a allowing index to be repeated field should solve this problem (and likely not break any existing users).