I think the problem is that the testing tool is trying to reset the
database and when it tries to truncate this table it can't. Well, I'm
pretty sure, but I don't know how to fix it. The table references itself.

On 15 February 2012 14:06, 赵帅 <rostin...@gmail.com> wrote:

>
> Did you delete one key or update the key to different values that was
> referenced by another table as foreign key.
> 2012/2/15 xina towner <xinatow...@gmail.com>
>
>> Hello, I get this error when I try to test my app. I'm using mysql. I
>> think it's when django tries to delete the table. I've tried with all On
>> delete options and the error keeps happening.
>>
>> IntegrityError: (1452, 'Cannot add or update a child row: a foreign key
>> constraint fails (`test_django`.`locations_location`, CONSTRAINT
>> `locations_location_ibfk_1` FOREIGN KEY (`belongsTo_id`) REFERENCES
>> `locations_location` (`id`) ON DELETE SET NULL ON UPDATE SET NULL)')
>>
>>
>> --
>> Gràcies,
>>
>> Rubén
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Gràcies,

Rubén

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to