Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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");
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #list #unique #indexes
ADD COMMENT
Topic
Name
8+8 =