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

Regression in GormTag index and unique_index handling #211

Open
pjediny opened this issue Jul 23, 2021 · 0 comments
Open

Regression in GormTag index and unique_index handling #211

pjediny opened this issue Jul 23, 2021 · 0 comments

Comments

@pjediny
Copy link

pjediny commented Jul 23, 2021

This code from version v0.21.0 will never allow for index; tag to be generated:

	if len(tag.Index) > 0 {
		if tag.GetIndex() == "" {
			gormRes += "index;"
		} else {
			gormRes += fmt.Sprintf("index:%s;", tag.GetIndex())
		}
	}

Same holds for the unique_index;.

The code should allow encoding three states:

  • index without name
  • index with name
  • no index

Currently it only allows index with name and no index variants. This is regression from previous version (v0.20.1).

Looking into GormTag proto message definition, it looks like it is not using optional anymore.

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