Skip to content

Commit cbf04d1

Browse files
committed
fix: trim suffixes excess
1 parent 7de5e75 commit cbf04d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/generator/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func BuildRelationFields(table objects.Table, relations []state.Relation) (mappe
332332
}
333333

334334
if r.JoinRelation != nil {
335-
throughSuffix := fmt.Sprintf("%s_%s_%s_%s", r.Through, r.SourcePrimaryKey, r.TargetPrimaryKey, r.JoinsSourceForeignKey)
335+
throughSuffix := fmt.Sprintf("%s_%s", r.Through, strings.Replace(r.JoinsSourceForeignKey, "_id", "", -1)))
336336
r.Table = fmt.Sprintf("%sThrough%s", inflection.Plural(r.Table), utils.SnakeCaseToPascalCase(inflection.Singular(throughSuffix)))
337337
}
338338

0 commit comments

Comments
 (0)