Laravel migration (errno: 150 “Foreign key constraint is incorrectly formed”)

后端 未结 18 2475
谎友^
谎友^ 2020-12-05 14:15

I have an orders table and a have a sell_shipping_labels which references orders.id as a foreign. However when I run the Laravel migration I get th

18条回答
  •  眼角桃花
    2020-12-05 15:01

    I faced this problem today. My parent table primary key datatype and child table data type was same but error was still there. I have found that my parent and child tables storage engine was different. I have fixed this issue by making both tables storage engine InnoDB from my phpmyadmin.

提交回复
热议问题