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

后端 未结 18 2498
谎友^
谎友^ 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:10

    I had the same problem and fixed the issue setting the database type to innoDB

    The tables created before the migration where 'MyISAM from an legacy system and the migrated are innoDB by default, so the mix of table types were an issue in my case.

提交回复
热议问题