vendredi 2 septembre 2016

Laravel5 Migration Error: 1170 BLOB/TEXT column `body` used in key specification without a key length

While running the migration via composer, I get the error.

Migration schema:

Schema::create('articles', function (Blueprint $table) {
        $table->increments('id');
        $table->string('title', 255)->index();
        $table->string('slug', 255)->index();
        $table->string('body')->index()->unique();
        $table->string('excerpt')->nullable();
    });
}

I tried changing the body to, but without a difference.

$table->string('body', 64000)->index()->unique();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire