Ограничение внешнего ключа сформировано неправильно. Не удалось добавить внешний ключ строки - PullRequest
0 голосов
/ 09 марта 2020

Я пытаюсь создать ограничение внешнего ключа строки. Гайка ничего не работает. Таблица счетов-

Schema::create('accounts', function (Blueprint $table) {
        $table->engine = 'InnoDB';
        $table->string('customer_id');
        $table->foreign('customer_id')->references('customer_id')->on('customers');
        $table->string('ac_type_id');
        $table->string('ac_number')->primary();
        $table->string('ac_balance');
        $table->string('password');
        $table->timestamps();
    });

Таблица клиентов-

Schema::create('customers', function (Blueprint $table) {
        $table->string('customer_id')->primary();
        $table->string('first_name');
        $table->string('last_name');
        $table->string('mobile_no');
        $table->string('email_id');
        $table->string('address');
        $table->date('dob');[enter image description here][1]
        $table->timestamps();
    });

Это ошибка, которую я получаю всегда This is error I'm getting always

...