#25690: Order of Migrations Commands Needs to Allow for All Field Changes
----------------------------+--------------------
Reporter: mcrowson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
When a migration contains changes to all fields, and a removal of the pk
field and the addition of a new pk field, the migration fails. This is due
to the migrations removals before the additions. This yields the warning
that an empty table should be dropped before the new fields can be added.
django.db.utils.OperationalError: (1090, "You can't delete all columns
with ALTER TABLE; use DROP TABLE instead")
By moving the migration commands I was able to get the migration to
perform successfully.
First: Remove the existing pk
Second: Add the new pk
Lastly: the migration commands as they were initially created.
--
Ticket URL: <https://code.djangoproject.com/ticket/25690>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.2d5ce66e1056cec00e423b7d09ea507a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.