-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[11.x] Add column type for native UUID #50192
Conversation
Not totally sure I want the breaking change if people opt-in to this. 😬 I wonder if a |
It's more about the breaking changes involved. If you already have an app in production using uuid() where it creates a char(36), then you upgrade to Laravel 11 and setup a new dev machine, your column locally is now a native UUID but production is a char(36). |
I understand, but I think it's easier to explain this on the L11 upgrade guide (user may explicitly use But if we are going to use a modifier, I suggest |
@taylorotwell Would you make this a MariaDB-only method/modifier or should it work with all DBMS that have a native column type for UUIDs (MariaDB, PostgreSQL, SQL Server) and throw an exception for all other DBMS? |
I think it would work on all databases that support it and throw an exception on other DBs. |
We are using MariaDB and UUID's and I would prefer the breaking change over a The breaking change better aligns with what we expect: a native type if possible, or a generic fallback. The upgrade guide would have to mention this of course and maybe the upgrade guide could give a small code example of how to convert existing |
@johanrosenson I personally also prefer the breaking change. If there is ever a good time for this, it would be now. @taylorotwell I reverted the changes and added the There are three helper methods for UUIDs: |
Decided to just go with your original commit of using native UUID on |
With the new dedicated driver, MariaDB users can now benefit from the native column type for UUIDs (Laravel uses
char(36)
at the moment).This would be a breaking change for existing applications, but since the driver is new, users have to consciously switch to it and will be made aware of this change. They should convert their existing UUID columns to the native type. I'll document it in the upgrade guide.