Skip to content

Commit

Permalink
fix: fix panic message when has-many encounter an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Skandalik committed Mar 22, 2022
1 parent 062f6f4 commit cfd2747
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schema/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ func (t *Table) hasManyRelation(field *Field) *Relation {
rel.BaseFields = append(rel.BaseFields, f)
} else {
panic(fmt.Errorf(
"bun: %s has-one %s: %s must have column %s",
"bun: %s has-many %s: %s must have column %s",
t.TypeName, field.GoName, t.TypeName, baseColumn,
))
}
Expand All @@ -630,7 +630,7 @@ func (t *Table) hasManyRelation(field *Field) *Relation {
rel.JoinFields = append(rel.JoinFields, f)
} else {
panic(fmt.Errorf(
"bun: %s has-one %s: %s must have column %s",
"bun: %s has-many %s: %s must have column %s",
t.TypeName, field.GoName, t.TypeName, baseColumn,
))
}
Expand Down

0 comments on commit cfd2747

Please sign in to comment.