Forums

django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')

Hi I am trying to get my Django 1.11.23 project running. The same code worked just fine in my local virtual machine. Now when I run "python manage.py migrate" i get the following error:

django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')

I searched the forums for an answer to this, but to the best of my knowledge, did not find any. Also, I did not post the stacktrace, because I wanted to know if it has something to do with InnoDb or MyIsam.

Any pointers or direction will be very much appreciated. Thanks.

I don't think it's anything to do with the database storage engine. The full stack trace would be helpful, though.