Answers for "laravel migration down should disable foreign key"

PHP
1

disable foreign key laravel

//...
class ClearOldOauthRelations extends Migration
{
    public function up()
    {
        Schema::disableForeignKeyConstraints();
        // drop foreign keys
        Schema::table('oauth_access_tokens', function (BluePrint $table) {
            $table->dropForeign('oauth_access_tokens_session_id_foreign');
        });
        //...
        Schema::enableForeignKeyConstraints();
    }
    //...
}
Posted by: Guest on October-06-2021
0

laravel migration drop foreign keys

$table->dropIndex(['state']); // Drops index 'geo_state_index'
Posted by: Guest on November-30-2020

Code answers related to "laravel migration down should disable foreign key"

Browse Popular Code Answers by Language