On the Book model I have set db_constaint=False:
{{{
capture_user = models.ForeignKey(
settings.AUTH_USER_MODEL, editable=False, null=False, blank=False,
db_constraint=False, to_field='user_id')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27315>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Can you provide a sample project that reproduces the issue and can you
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#bisecting-a-regression bisect] to find the commit where the
failure was introduced? It might be
fcd08c175787e909b3eb98f756317a07741c48dd.
--
Ticket URL: <https://code.djangoproject.com/ticket/27315#comment:1>
Comment (by Alex Rothberg):
I think the issue has something to do with the migration engine. I have
one migration now with a series of operations. One of the earlier
operations `CreateModel` (with the field set to `db_constraint=True`); a
later operation (in the same migration) then sets `db_constraint=False`.
This all works in Django 1.9 but not 1.10.
If I modify the earlier `CreateModel` operation to set the field initially
to `db_constraint=False`, then my tests all pass.
--
Ticket URL: <https://code.djangoproject.com/ticket/27315#comment:2>
Comment (by Alex Rothberg):
Sometime before: 354acd04af524ad82002b903df1189581c51cabe
--
Ticket URL: <https://code.djangoproject.com/ticket/27315#comment:3>
Comment (by Alex Rothberg):
This seems to be the commit that is causing the issues:
https://github.com/django/django/commit/fcd08c175787e909b3eb98f756317a07741c48dd
--
Ticket URL: <https://code.djangoproject.com/ticket/27315#comment:4>
Comment (by Tim Graham):
Without a sample project to reproduce the issue, it's difficult for me to
say if this is something that Django should/can fix or if it's an issue in
your project that you'll need to adapt for that change.
--
Ticket URL: <https://code.djangoproject.com/ticket/27315#comment:5>
* status: new => closed
* resolution: => needsinfo
Comment:
I tried to reproduce, but didn't have any luck, except if I removed the
migration that changed the field to `db_constraint=False`. Please reopen
if you can provide a sample project and hopefully explain why Django is at
fault. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/27315#comment:6>