dropForeign(['account_id', 'site_id']); $table->dropForeign(['provider_oauth_id', 'site_id']); $table->dropIndex('account_provider_account_id_site_id_foreign'); $table->dropIndex('account_provider_provider_oauth_id_site_id_foreign'); }); DB::statement('ALTER TABLE account_provider RENAME TO account__provider'); Schema::table('account__provider', function (Blueprint $table) { $table->foreign(['account_id', 'site_id'])->references(['id', 'site_id'])->on('accounts'); $table->foreign(['provider_oauth_id', 'site_id'])->references(['id', 'site_id'])->on('provider_oauth'); }); } /** * Reverse the migrations. * * @return void */ public function down() { abort(500,'cant go back'); } };