-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] drop binary variants of UID types #39113
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
Conversation
cd3e53b
to
ca31148
Compare
Is it possible to change your mind on this? Storing a UUID as string on MySQL seems to be inferior to storing it in MySQL ships with functions like And you know, if the project is already running on MySQL, "use Postgres" is not really a viable option. |
Instead of defaulting to a varchar, we could default to binary when a DB storage doesn't have a native GUID type. |
ca31148
to
bdfc205
Compare
@derrabus updated to my last proposal. |
Thank you @nicolas-grekas. |
@nicolas-grekas @javiereguiluz This conflicts with this article which needs to be updated https://symfony.com/blog/new-in-symfony-5-2-doctrine-types-for-uuid-and-ulid |
#39112 made me realize that when the DB engine doesn't have a native UUID/GUID type, there's no benefit to representing ULIDs as UUIDs.
This PR proposes to use the native GUID type for both UUIDs and ULIDs only when the DB engine provides such a type, and to use
BINARY(16)
when the DB engine doesn't have a native GUID type.This leaves us in a situation where, whether the DB engine supports GUID natively or not, UUID and ULID are always stored in the most compact format.
This makes the "binary" variants useless.
MySQL 8 has functions to deal with binary GUID, and so does SQLite.