#27315: IntegrityError: insert or update on table violates foreign key 
constraint
on Django 1.10
-------------------------------+--------------------
     Reporter:  Alex Rothberg  |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.10
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 I am running my test suite on Django 1.10 (it passes on Django 1.09) and
 am seeing a number of failures like:
 {{{
 IntegrityError: insert or update on table "item_storage_books" violates
 foreign key constraint
 "item_storage_s_capture_user_id_a4181270_fk_users_myuser_user_id"
 DETAIL:  Key (capture_user_id)=(alex) is not present in table
 "users_myuser".
 }}}

 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.

-- 
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/052.608ce6acec46e9f01d24d8946f54435a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to