Workaround for `ValueError: Dependency on app with no migrations` in #22848 may need attention
|Reported by:||Steve Jalim||Owned by:||Iacopo Spalletti|
|Cc:||Iacopo Spalletti||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
Description (last modified by )
May I suggest either an extension to the fix made in #22848 or a note in documentation about it?
(TLDR for that ticket: starting a project with a custom user model and no migrations yet led to an exception when
makemigrations was run, so @andrewgodwin added a special case for the creation of a first migration)
I just hit what appeared to be the same issue myself, found the ticket, checked my Django version (1.7 RC3) and thought all should be well, but I thought it still wasn't working for me until I actually read the patch and saw why:
There's still a subtle gotcha where
migrate --list will still throw the dependency error, while
makemigrations <app name> will happily run. So if someone gets Dependency on app with no migrations when starting
runserver and they then try to check their migrations list, they will be prevented from doing so and they have no cue to as to what they can do to remedy things.
It's a corner case, sure, but likely will lead to user frustration for those stuck in that corner.
One solution would be to extend the no-migrations behaviour to
--list. Alternatively if we collectively just want a patch for the docs, I'd be happy to submit one. I think the an aside in the custom user docs seems a sensible place, but it would need a little background added in the same patch, too. Anyone disagree?
Change History (15)
comment:1 Changed 2 years ago by
|Component:||Uncategorized → Migrations|
|Type:||Uncategorized → Bug|
|Version:||1.6 → 1.7-rc-3|