About the unique of uuid #304
fan-tastic-z
started this conversation in
General
Replies: 3 comments 1 reply
-
Move to discussions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I would like to ask if I am using this incorrectly? Should id be used when creating one-to-many and many-to-many? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thoughts on CUID? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
After reading this #245
I asked a question about whether it is best to use the pid field when establishing foreign keys and many-to-many relationships.
Through a simple code, it was discovered that if pid is used as a foreign key association, since uuid is unique by default in loco,As a result, multiple pieces of data cannot be added due to unique constraints.
Therefore, I would like to ask whether you should consider letting users choose unique_key when using uuid?
In other words, when it comes to one-to-many and many-to-many, the default id field should still be used for association
Beta Was this translation helpful? Give feedback.
All reactions