-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Uid] Add a note on the use of entity primary keys #19705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please share some resources where they explain that this is a bad practice and the reasons for it? Also, let's keep in mind that we have lots of different UIDs, so maybe some are bad for PKs but not others. Thanks! |
For my part, I use ULIDs. Yes, there is the comment symfony/symfony#41544 (comment). What do you think ? |
I'm afraid that's not enough. We'd need good resources that provide reasoned arguments to prove that this is a bad practice. E.g. if it's bad for performance reasons, show a good benchmark, etc. Thanks. |
I don't have any resources, benchmarks, etc. |
If you use ULID, then you can also use UUID V7. Like ULID, UUID V7 also provides monotonically increasing values that are lexicographically sortable. I've been using V7 as primary keys without any issues. |
I search about this and read a lot of different posts. There seems to be a consensus on the drawbacks, so I propose to add that in #19783. |
Uh oh!
There was an error while loading. Please reload this page.
It would be interesting to add a note on the use U*id values for primary key in an entity.
This use is bad practice.
What do you think ?
The text was updated successfully, but these errors were encountered: