MySQL Error 1215: Cannot add foreign key constraint

前端 未结 30 2754
予麋鹿
予麋鹿 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:23

    I'm guessing that Clients.Case_Number and/or Staff.Emp_ID are not exactly the same data type as Clients_has_Staff.Clients_Case_Number and Clients_has_Staff.Staff_Emp_ID.

    Perhaps the columns in the parent tables are INT UNSIGNED?

    They need to be exactly the same data type in both tables.

提交回复
热议问题