Replies: 2 comments 2 replies
-
Bun does not automatically detect foreign keys. We have #197 to track this, but no work has been done in that direction. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@vmihailenco I am in a sort of similar predicament. I have found this method https://github.com/uptrace/bun/blob/master/query_table_create.go#L88 that is part of the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, if I have a model like this:
And I only use
db.NewCreateTable()
, without usingForeignKey()
. Then will Bun use foreign key automatically since there arerel:has-one
?Beta Was this translation helpful? Give feedback.
All reactions