From 7a71858f0c856851516a731480207b56d0f327c6 Mon Sep 17 00:00:00 2001 From: benevolent0505 Date: Fri, 25 Apr 2025 08:09:28 +0900 Subject: [PATCH] Fix InsertWhitelist test in composite primary key table - The table has a composite primary key with columns that have default values and columns that don't. - ColumnsWithoutDefault columns don't guarantee unique records. --- templates/test/insert.go.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/test/insert.go.tpl b/templates/test/insert.go.tpl index 39d46447d..102ebf1fa 100644 --- a/templates/test/insert.go.tpl +++ b/templates/test/insert.go.tpl @@ -39,7 +39,7 @@ func test{{$alias.UpPlural}}InsertWhitelist(t *testing.T) { {{if not .NoContext}}ctx := context.Background(){{end}} tx := MustTx({{if .NoContext}}boil.Begin(){{else}}boil.BeginTx(ctx, nil){{end}}) defer func() { _ = tx.Rollback() }() - if err = o.Insert({{if not .NoContext}}ctx, {{end -}} tx, boil.Whitelist({{$alias.DownSingular}}ColumnsWithoutDefault...)); err != nil { + if err = o.Insert({{if not .NoContext}}ctx, {{end -}} tx, boil.Whitelist(strmangle.SetMerge({{$alias.DownSingular}}PrimaryKeyColumns, {{$alias.DownSingular}}ColumnsWithoutDefault)...)); err != nil { t.Error(err) }