How to delete Unique key on multiple columns?

laravel, migration

Solution

To drop a unique index, you use `dropUnique('name_of_index')`.

If you're not specifying an index name in the second parameter of `unique()`, the name of the index will be `tableName_fieldsSeperatedByUnderscore_unique`.

public function down()
{
    Schema::table('topics', function($table)
    {
        $table->dropUnique('topics_subject_id_grade_id_semester_id_name_unique');
    }
}

Problem

How do I reverse a unique key added on multiple columns in Laravel? Basically, what should go in the down() function of this migration code: ``` public function up() { Schema::table('topics', function($table) { $table->unique(array('subject_id', 'grade_id', 'semester_id', 'name')); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('topics', function($table) { } } ```

Original source