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: MarkusH 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


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 MarkusH

  • Cc info@… added
  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by apollo13

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 3 years ago by rjasjukaitis

  • Owner set to rjasjukaitis
  • Status changed from new to assigned

comment:4 Changed 3 years ago by rjasjukaitis

  • Cc rjasjukaitis added

I added a paragraph to the migration documentation. Asking for review:

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

  • Resolution set to fixed
  • Status changed from assigned to closed

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