Opened 4 years ago

Last modified 4 years ago

#31837 closed Uncategorized

Possible manager migration bug — at Version 1

Reported by: Gordon Wrigley Owned by: nobody
Component: Migrations Version: 3.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Gordon Wrigley)

If I understand managers and migrations correctly then the change in this commit https://github.com/tolomea/django-tutorial/commit/e5df712ef10be91cd2e5d28c9df48e33254a2b10 produces a bad migration.

Specifically I expect the migration to include both managers but it omits the "objects" manager.

This causes a problem in the followup data migration https://github.com/tolomea/django-tutorial/commit/90825038c55913d74a23b1c5c2ba35268d0a1367 where Question.objects isn't available leading to AttributeError: type object 'Question' has no attribute 'objects'

I have observed this in 3.0.8 and 2.2.14 (where I first ran into it)

Also I observed (on 2.2.14 didn't check this on 3.0.8) that adding objects to the concrete model (or an additional abstract model in between) fixes the problem.

Change History (1)

comment:1 by Gordon Wrigley, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top