SQLSTATE [HY000]:常规错误:1215无法添加外键约束laravel 5.6.5

时间:2018-03-13 17:44:56

标签: php mysql laravel

你好,我正在尝试迁移 但我没有工作

此迁移文件

public function up()
    {
        Schema::create('chanels', function (Blueprint $table) {
            $table->increments('id_chanel');
            $table->string('name');
            $table->integer('id_owner')->unsigned();
            $table->foreign('id_owner')->references('id_owner')->on('owners');
            $table->integer('id_responsable')->unsigned();
            $table->foreign('id_responsable')->references('id_responsable')->on('responsables');
            $table->integer('id_teleport')->unsigned();
            $table->foreign('id_teleport')->references('id_teleport')->on('teleports');
            $table->integer('id_provider')->unsigned();
            $table->foreign('id_provider')->references('id_provider')->on('providers');
            $table->string('satelite');
            $table->string('frequency');
            $table->integer('id_user')->unsigned();
            $table->foreign('id_user')->references('id_user')->on('users');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chanels');
    }

但是我遇到了这个问题image of issue

谢谢你的帮助

0 个答案:

没有答案