#23366: Workaround for `ValueError: Dependency on app with no migrations` in 
#22848
may need attention
----------------------------+------------------------------------
     Reporter:  stevejalim  |                    Owner:  yakky
         Type:  Bug         |                   Status:  assigned
    Component:  Migrations  |                  Version:  1.7
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  1           |      Needs documentation:  0
  Needs tests:  1           |  Patch needs improvement:  0
Easy pickings:  1           |                    UI/UX:  0
----------------------------+------------------------------------
Description changed by MarkusH:

Old 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?

New 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 `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?

--

--
Ticket URL: <https://code.djangoproject.com/ticket/23366#comment:12>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.2cfd004a5719c78fba68fec0893e0683%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to