移行をロールバックしようとしています。
私の移行ファイルはそのように外部キーを使用しています
$table->foreign('user_one')->references('id')->on('users');
$table->foreign('user_two')->references('id')->on('users');
私の down() 関数はそうです
public function down()
{
Schema::drop('pm_convo');
Schema::drop('pm_convo_replys');
}
移行コマンドを実行すると
php artisan migrate:refresh --seed --env=local
次のエラーが表示されます
SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails (SQL: drop table `pm_convo`)
これを修正するために何をすべきか正確にはわかりません。
編集:
私が試してみました:$table->dropForeign('pm_convo_user_one_foreign');
しかし、それでもエラーが発生します