The migration looks like this:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateExtensiontablesRegistry extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('extensiontables_registry', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('extensiontable_name')->nullable(false);//->unique();
$table->timestamps();
$table->unique('extensiontable_name', 'test');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('extensiontables_registry');
}
}
Now, when I run it, I get the following errors to my cmd:
In Connection.php line 669:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 767 bytes (SQL: alter table `extensiontables_reg
istry` add unique `test`(`extensiontable_name`))
In Connection.php line 463:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 767 bytes
Why is that? I mean, "test" cant be a too long keyname, can it? I also tried this approach: https://laravel-news.com/laravel-5-4-key-too-long-error
But it didnt help either :(