Opened 10 years ago

Last modified 10 years ago

#23366 closed Bug

Workaround for `ValueError: Dependency on app with no migrations` in #22848 may need attention — at Initial Version

Reported by: Steve Jalim Owned by: nobody
Component: Migrations Version: 1.7
Severity: Normal Keywords:
Cc: Iacopo Spalletti Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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 makemigrations --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 (0)

Note: See TracTickets for help on using tickets.
Back to Top