Reputation: 1536
I have two tables.
tableone: id, tabletwo_id
tabletwo: id, tableone_id
structure is something like that. they are connected using foreign key, but now I can't delete these tables at all. I mean laravel rollback doesn't work, tableone expects tabletwo to be deleted first and vice versa. So what can I do?
Upvotes: 1
Views: 54
Reputation: 8618
You must be firstly delete foregin key constrant, then table.
Schema::table('tabletwo', function(Blueprint $table)
{
$table->dropForeign('tabletwo_table_one_id_foreign');
});
Schema::drop('tabletwo');
Upvotes: 3