Opened 20 months ago

Closed 19 months ago

Last modified 19 months 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

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 20 months ago by MarkusH

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

comment:2 Changed 20 months ago by apollo13

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 20 months ago by rjasjukaitis

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

comment:4 Changed 20 months 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 19 months 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 19 months 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