MySQL Error 1215: Cannot add foreign key constraint

前端 未结 30 2761
予麋鹿
予麋鹿 2020-11-22 01:37

I am trying to forward engineer my new schema onto my db server, but I can\'t figure out why I am getting this error. I\'ve tried to search for the answer here, but everyth

30条回答
  •  不思量自难忘°
    2020-11-22 02:09

    When this error occurrs because the referenced table uses the MyISAM engine this answer provides a quick way to convert your database so all Django model tables use InnoDB: https://stackoverflow.com/a/15389961/2950621

    It's a Django management command called convert_to_innodb.

提交回复
热议问题