Sadly there's no other way. you must change the timestamps manually.
Changing Migration Order
I'm getting a "General error: 1005 Can't create table" when I try to migrate my tables after making creating some foreign key constraint changes.
I understand why the errors are happening - my current migration order isn't creating my parent tables before the child ones, and so my foreign keys are getting all messed up because the tables they depend on don't exist yet. But it seems a bit hacked (and inconvenient) to change the migration order by arbitrarily changing the timestamps of each migration to make them execute in the proper order.
2015_06_29_191903_create_child_table
2015_07_06_144544_create_parent_table
Is there a good Artisan tool to change the order in which migrations are applied? I haven't found anything online but people just making up fake timestamps in the order they want.
Hey @lcopeland, I think it may help to understand the motivations of migrations. The idea is to incrementally make changes to your database schema so they can be applied in order, and when you've deployed a real life application, changes can be made to your database without rebuilding the whole database from scratch.
So each time you make modifications to your schema, you should be creating a new migration rather than editing old ones.
If you've created migrations out of order, maybe try adding a new migration after them to add your foreign key constraints.
Hope this helps :)
Please or to participate in this conversation.