Monday, December 12, 2016

Re: makemigrations generates new migration when nothing has changed

On 13/12/2016 9:58 AM, Francis Fisher wrote:
> On Wednesday, 30 November 2016 22:43:55 UTC, Mike Dewhirst wrote:
>
> On 1/12/2016 3:56 AM, Francis Fisher wrote:
> > Any idea why makemigrations would fail to recognise that a
> migration
> > has already been generated?
>
> I think migrations is seeing field choices differently each time it
> scans the model. Can you use a list rather than a tuple for
> choices? (Or
> vice versa - I don't remember) Or import the choices from another
> module?
>
> Thanks for this suggestion - I am using a field with choices somewhere
> in the model referenced by a ForeignKey.
>
> I tried switching the choices from a tuple of tuples to a list of
> lists, and I tried defining the choices in another module, I also
> tried entirely removing the choices argument from the field
> definition, however none of those actions resolved the issue. I've
> since tried this action with django 1.10.4 but to no avail.

I'm using 1.8 so I can't help there.

>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a66060ed-5ae1-4517-a9bd-1dcdc6cb49f8%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a66060ed-5ae1-4517-a9bd-1dcdc6cb49f8%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d98ea391-4524-f70a-bbf9-4e5d1fb9864b%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment