Skip to content
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

Added native UUID field type for MariaDB1070+ #6310

Open
wants to merge 1 commit into
base: 5.0.x
Choose a base branch
from

Conversation

juanparati
Copy link

Summary

MariaDB 10.7.0+ implements a native UUID field type (Guid) that works in similar way of Postgres UUID.

+Info: https://mariadb.com/kb/en/uuid-data-type/

@derrabus
Copy link
Member

Thank you for your interest in contributing to the Doctrine project. However, we don't accept changes to our codebase that come without any tests. Furthermore, we don't accept any features on the 5.0.x branch. Please target 4.1.x instead.

Please be aware that supporting MariaDB's UUID type has been attempted before (#5990). The missing part here, as far as I remember, was the migration of UUID field with a foreign key constraint. You can continue that work if you like.

@juanparati
Copy link
Author

@derrabus : I could provide a PR for 4.1.x. very quickly, however the migration part it's very tricky because it's not only about to modify char(36) to UUID type.

Depending of MariaDB version some UUID formats are not accepted (In version 10.9.8 UUIDs with version >= 8 and variant 0 are not accepted), UUIDs can be also migrated from binary(16) and char(32) (https://mariadb.org/10-7-preview-feature-uuid-data-type/).

@derrabus
Copy link
Member

however the migration part it's very tricky because it's not only about to modify char(36) to UUID type.

Yes, it is the only case we need to cover. Columns that have been declared as UUID through the DBAL are CHAR(36) at the moment and once an app updates DBAL, it will try to migrate those columns to UUID. That's the case we need to handle properly.

UUIDs can be also migrated from binary(16)

That's out of scope. If someone used a BINARY(16) column to store their UUID, they won't have any trouble upgrading DBAL. Those binary columns will still work as they did before.

@juanparati
Copy link
Author

I will take a look to the migration issue during this weekend.

Can you provide me any insights about where the migration test should be placed?

@derrabus
Copy link
Member

Did you look into #5990?

@juanparati
Copy link
Author

Yes, I got idea looking at 7673c87

I will try to work on that during next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants