dbal icon indicating copy to clipboard operation
dbal copied to clipboard

Added native UUID field type for MariaDB1070+

Open juanparati opened this issue 1 year ago • 7 comments

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/

juanparati avatar Feb 20 '24 14:02 juanparati

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.

derrabus avatar Feb 20 '24 19:02 derrabus

@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/).

juanparati avatar Feb 21 '24 10:02 juanparati

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.

derrabus avatar Feb 21 '24 10:02 derrabus

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?

juanparati avatar Feb 22 '24 07:02 juanparati

Did you look into #5990?

derrabus avatar Feb 22 '24 08:02 derrabus

Yes, I got idea looking at https://github.com/doctrine/dbal/pull/5990/commits/7673c8745dd19594b4a5475a112a9f182ae61dc2

I will try to work on that during next week.

juanparati avatar Feb 23 '24 07:02 juanparati

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar May 24 '24 03:05 github-actions[bot]

This pull request was closed due to inactivity.

github-actions[bot] avatar Jun 01 '24 03:06 github-actions[bot]