Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21499 closed Cleanup/optimization (fixed)

Migrations won't work if field signature changes

Reported by: Markus Holtermann Owned by: rjasjukaitis
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: info@…, rjasjukaitis Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

If the __init__ signature of a model field changes in the way that e.g. a positional argument is added / removed and doesn't replace / isn't replaced by a previously existing keyword argument, the old migration files won't work any more because the rely on the actual __init__ signature to create an instance of the field.

This should be documented in the respective custom field and migration docs.

Change History (6)

comment:1 Changed 3 years ago by Markus Holtermann

Cc: info@… added
Easy pickings: set

comment:2 Changed 3 years ago by Florian Apolloner

Triage Stage: UnreviewedAccepted

comment:3 Changed 3 years ago by rjasjukaitis

Owner: set to rjasjukaitis
Status: newassigned

comment:4 Changed 3 years ago by rjasjukaitis

Cc: rjasjukaitis added

I added a paragraph to the migration documentation. Asking for review: https://github.com/django/django/pull/1985

comment:5 Changed 3 years ago by Raphael Jasjukaitis <r.jasjukaitis@…>

Resolution: fixed
Status: assignedclosed

In 455e2896b122a331057483634bea9c8074bdc97d:

Fixed #21499 -- Added a paragraph to the docs.

comment:6 Changed 3 years ago by Andrew Godwin <andrew@…>

In 0c46ca83e820cd725f5d0fa299c2b5405bfeee1b:

Merge pull request #1985 from raphaa/21499

Fixed #21499 -- Migrations won't work if field signature changes

Note: See TracTickets for help on using tickets.
Back to Top