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
I was also getting the same error. What i was doing in users table is,
$table->unsignedInteger('role_id')->default(2);
table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
But i have created the role table after creating users table. So, i edited the role migration file name date before the users table filename date. Like this,
2013_01_22_091213_create_roles_table.php
2014_10_12_000000_create_users_table.php
And finally it works. Maybe sometime you may get this problem. So, i posted it.