Level 14
Migrations run in the order they are created. You need to rearrange your migration order for it to work. Simply change their creation times until you've got your correct order. So you run Users then Cards then Notes.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I create 3 tables with name users,cards and notes and write my relation in note migration and when migrate at first cards table create and after that notes table create and when run the relation because users table not created yet Got error and can't execute my relation.
what can I do for that??????????????
Migrations run in the order they are created. You need to rearrange your migration order for it to work. Simply change their creation times until you've got your correct order. So you run Users then Cards then Notes.
Please or to participate in this conversation.