From cfd27475fac89a1c8cf798bfa64898bd77bbba79 Mon Sep 17 00:00:00 2001 From: Hugon Sknadaj Date: Tue, 22 Mar 2022 15:50:45 +0100 Subject: [PATCH] fix: fix panic message when has-many encounter an error --- schema/table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/table.go b/schema/table.go index 927f4aa0..1a8393fc 100644 --- a/schema/table.go +++ b/schema/table.go @@ -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, )) } @@ -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, )) }