Drop Unique Index Laravel

Viewed 52271

I kept getting this while run php artisan migrate

SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'email'; check that column/key exists

While I see that email is exist on my database.

enter image description here


My migration script. I was trying to drop the unique constraint.

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterGuestsTable3 extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('guests', function(Blueprint $table)
        {
            $table->dropUnique('email');

        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('guests', function(Blueprint $table)
        {

            $table->dropUnique('email');

        });
    }

}

Did I forget to clear any caches ?

Any hints for me ?

2 Answers
Related