Answers for "laravel list unique indexes"

PHP
0

laravel list unique indexes

Schema::table('persons', function (Blueprint $table) {
    $sm = Schema::getConnection()->getDoctrineSchemaManager();
    $indexesFound = $sm->listTableIndexes('persons');

    if(array_key_exists("persons_body_unique", $indexesFound))
        $table->dropUnique("persons_body_unique");
});
Posted by: Guest on September-10-2021

Browse Popular Code Answers by Language