Skip to content

Commit

Permalink
Merge pull request #34 from Shelnutt2/issue-33
Browse files Browse the repository at this point in the history
Fix including primary_key with json tags
  • Loading branch information
Shelnutt2 authored Apr 29, 2020
2 parents 0eb70da + b765416 commit 2234744
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func generateMysqlTypes(obj map[string]map[string]string, depth int, jsonAnnotat
annotations = append(annotations, fmt.Sprintf("gorm:\"column:%s%s\"", key, primary))
}
if jsonAnnotation == true {
annotations = append(annotations, fmt.Sprintf("json:\"%s%s\"", key, primary))
annotations = append(annotations, fmt.Sprintf("json:\"%s\"", key))
}
if len(annotations) > 0 {
structure += fmt.Sprintf("\n%s %s `%s`",
Expand Down

0 comments on commit 2234744

Please sign in to comment.