Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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();
    }
    //...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #disable #foreign #key #laravel
ADD COMMENT
Topic
Name
7+9 =