#34151: Adding explicit primary key with different type doesn't update related
ManyToManyFields.
-------------------------------------+-------------------------------------
Reporter: STANISLAV LEPEKHOV | Owner: (none)
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: migrations pk uuid | Triage Stage: Accepted
relation |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Bhuvnesh):
* owner: Bhuvnesh => (none)
* status: assigned => new
Comment:
OK, so i did some more work on this and found that it is much more
complicated than i thought it would be:
1. You CANNOT switch pk field type if you already have some data in it
without custom operations.
2. the naive solution could be to remake all the tables that are
referencing to a model's pk but even that is not possible in MySql as we
cannot drop a table if it is referenced by other table.(throws error in
case when 2 models are related to each other)
3. the only solution i can think of (and tried) is deleting all related
models and then recreating them with new uid field.
So i'm deassigning myself in case someone has a better solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/34151#comment:13>
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/010701865658d9ed-ddd00d6c-b02c-4bc8-9f49-d58c66f35bbc-000000%40eu-central-1.amazonses.com.