Without the string "on delete set null (reason_id)" it works.
What stack trace or error message from tbls did you see?
not found column 'reason_id) ON DELETE SET NULL (reason_id' on table 'public.reasons'
github.com/k1LoW/tbls/schema.(*Table).FindColumnByName
/Users/runner/work/tbls/tbls/schema/schema.go:226
github.com/k1LoW/tbls/drivers/postgres.(*Postgres).Analyze
/Users/runner/work/tbls/tbls/drivers/postgres/postgres.go:343
github.com/k1LoW/tbls/datasource.Analyze
/Users/runner/work/tbls/tbls/datasource/datasource.go:131
github.com/k1LoW/tbls/cmd.glob..func5
/Users/runner/work/tbls/tbls/cmd/doc.go:72
github.com/spf13/cobra.(*Command).execute
/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044
github.com/spf13/cobra.(*Command).Execute
/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/k1LoW/tbls/cmd.Execute
/Users/runner/work/tbls/tbls/cmd/root.go:194
main.main
/Users/runner/work/tbls/tbls/main.go:34
runtime.main
/Users/runner/hostedtoolcache/go/1.19.8/x64/src/runtime/proc.go:250
runtime.goexit
/Users/runner/hostedtoolcache/go/1.19.8/x64/src/runtime/asm_arm64.s:1172
Anything else we need to know?
The actions SET NULL and SET DEFAULT can take a column list to specify which columns to set. Normally, all columns of the foreign-key constraint are set; setting only a subset is useful in some special cases. Consider the following example:
What happened
Does not work when using some variants of the foreign key syntax in PostgreSQL.
Without the string "
on delete set null (reason_id)
" it works.What stack trace or error message from tbls did you see?
Anything else we need to know?
The actions SET NULL and SET DEFAULT can take a column list to specify which columns to set. Normally, all columns of the foreign-key constraint are set; setting only a subset is useful in some special cases. Consider the following example:
Environment
1.65.3
PostgreSQL 15.2
macOS Ventura 13.3.1
zsh