Workaround for `ValueError: Dependency on app with no migrations` in #22848 may need attention
|Reported by:||stevejalim||Owned by:||yakky|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
Description (last modified by MarkusH)
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 stevejalim
- Component changed from Uncategorized to Migrations
- Easy pickings set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Type changed from Uncategorized to Bug
- Version changed from 1.6 to 1.7-rc-3
comment:5 Changed 2 years ago by lukas-schulze
comment:6 Changed 2 years ago by sharifmamun
- Owner changed from nobody to sharifmamun
- Status changed from new to assigned
comment:7 Changed 22 months ago by timgraham
- Has patch set
- Needs tests set
- Version changed from 1.7-rc-3 to 1.7
comment:14 Changed 20 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from assigned to closed