codegen: add foreign key error check test
All checks were successful
CI / build-docker (push) Successful in 4s
CI / build-docker-bootstrap (push) Has been skipped
CI / release-test (push) Successful in 17s

This commit is contained in:
2026-01-31 20:35:03 -08:00
parent 3d357abb93
commit 1c56661560
4 changed files with 172 additions and 17 deletions

View File

@@ -214,7 +214,7 @@ func GenerateSaveItemFunc(tbl schema.Table) *ast.FuncDecl {
&ast.CallExpr{
Fun: ast.NewIdent("NewForeignKeyError"),
Args: []ast.Expr{
ast.NewIdent(`"Type"`),
&ast.BasicLit{Kind: token.STRING, Value: fmt.Sprintf("%q", structFieldName)},
ast.NewIdent(fmt.Sprintf("%q", col.ForeignKeyTargetTable)),
structField,
},