Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index tag should be a repeated field #230

Open
baryluk opened this issue May 6, 2022 · 0 comments
Open

index tag should be a repeated field #230

baryluk opened this issue May 6, 2022 · 0 comments

Comments

@baryluk
Copy link

baryluk commented May 6, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant