#36754: Bug in GeneratedField when it references a related field (e.g.
ForeignKey)
with 2 conditions (django happens to create multiple 000x_inital.py for the
app && the ForeignKey is first initialized in the later file
000x_inital.py)
-------------------------------------+-------------------------------------
Reporter: Ou7law007 | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: migrations | Triage Stage:
autodetector | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ou7law007):
Replying to [comment:1 David Sanders]:
> If this isn't already a duplicate, I coincidentally also just noticed
this bug when squashing my migrations today.
>
> Also my workaround was to simply remove the generated field from my
CreateModel operation, rerun makemigrations and then move the newly
gazetted operation back into the squashed migration.
OMG thank you. I thought I was crazy. I already fixed it by editing the
auto detector (I think): https://github.com/Ou7law007/django/tree/fix-
generatedfield-autodetector
Don't mind the '330 commits ahead', it's actually just 1 commit and 1 file
that changed. It's a fork of {{{/stable/5.2.x}}} and not {{{main}}} so...
This is the one commit:
https://github.com/Ou7law007/django/commit/a8fabc62cfdc52800d18341bfcd073303b6f4e63
Feel free to test it.
I still don't understand why importing the user model in the users initial
migration file causes django to create less initial migration files.
--
Ticket URL: <https://code.djangoproject.com/ticket/36754#comment:2>
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 view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019aba3f4b6d-a498d812-c6ac-4f55-ba71-808694ea3af2-000000%40eu-central-1.amazonses.com.