#33507: Use native UUID data type on MariaDB 10.7+
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mariadb | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
> With these basic conversion rules, you can migrate from your existing
CHAR/VARCHAR/TEXT hexadecimal text or BINARY/VARBINARY/BLOB encoded to
UUID using:
Unfortunately, this statement doesn't account for the fact that UUIDs are
often used as primary keys and thus referenced by other tables where this
approach simply won't work as you get in a chicken-egg problem with
foreign references. To perform this properly a manual dropping of
references, followed by type alterations of all tables involved, and final
step to recreate constraints is required which possibly will require table
rebuilds as Adam pointed out.
> But maybe the "upgrade path" there would be "create a field subclass
always backed by char(32)".
That seems like the most suitable upgrade path. It will likely require
documenting that all the generated migration operations should be wrapped
in `SeparateDatabaseAndState` unless we adapt the schema editor to avoid
`ALTER` when the generated SQL column of `from_field` and `to_field`
remains the same.
--
Ticket URL: <https://code.djangoproject.com/ticket/33507#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.b18026df9f51b532277925146dc2b29a%40djangoproject.com.