Skip to content

Commit

Permalink
fix: incorrect table relationship panic message #791
Browse files Browse the repository at this point in the history
  • Loading branch information
wikylyu committed Mar 4, 2023
1 parent 30bd011 commit ad41888
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions schema/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func (t *Table) belongsToRelation(field *Field) *Relation {
} else {
panic(fmt.Errorf(
"bun: %s belongs-to %s: %s must have column %s",
t.TypeName, field.GoName, t.TypeName, baseColumn,
t.TypeName, field.GoName, joinTable.TypeName, joinColumn,
))
}
}
Expand Down Expand Up @@ -588,7 +588,7 @@ func (t *Table) hasOneRelation(field *Field) *Relation {
} else {
panic(fmt.Errorf(
"bun: %s has-one %s: %s must have column %s",
field.GoName, t.TypeName, joinTable.TypeName, baseColumn,
field.GoName, t.TypeName, t.TypeName, baseColumn,
))
}

Expand All @@ -598,7 +598,7 @@ func (t *Table) hasOneRelation(field *Field) *Relation {
} else {
panic(fmt.Errorf(
"bun: %s has-one %s: %s must have column %s",
field.GoName, t.TypeName, joinTable.TypeName, baseColumn,
field.GoName, t.TypeName, joinTable.TypeName, joinColumn,
))
}
}
Expand Down Expand Up @@ -677,7 +677,7 @@ func (t *Table) hasManyRelation(field *Field) *Relation {
} else {
panic(fmt.Errorf(
"bun: %s has-many %s: %s must have column %s",
t.TypeName, field.GoName, t.TypeName, baseColumn,
t.TypeName, field.GoName, joinTable.TypeName, joinColumn,
))
}
}
Expand Down

0 comments on commit ad41888

Please sign in to comment.