Skip to content

Commit

Permalink
fix logic for setting projection attr
Browse files Browse the repository at this point in the history
  • Loading branch information
miyamo2 committed Jun 22, 2024
1 parent 6869d82 commit bff9765
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ func (m Migrator) CreateIndex(dst interface{}, name string) error {
}

projective := make([]string, 0)
if len(v.NonProjectiveAttrs) != 0 {
if len(v.NonProjectiveAttrs) == 0 {
projective = append(projective, "*")

Check warning on line 283 in migrator.go

View check run for this annotation

Codecov / codecov/patch

migrator.go#L283

Added line #L283 was not covered by tests
} else {
projective = slices.DeleteFunc(append(td.NonKeyAttr, td.PK.Name, td.SK.Name), func(s string) bool {
if s == v.PK.Name || s == v.SK.Name {
return true
Expand Down

0 comments on commit bff9765

Please sign in to comment.