mardi 16 avril 2019

Duplication of columns

I trying to create foreign keys for my laravel 5.8 project, but I am getting error: enter image description here

My migration file

    public function up()
    {
        Schema::table('chatter_discussion', function (Blueprint $table) {
            $table->integer('chatter_category_id')->unsigned()->index();
            $table->foreign('chatter_category_id')->references('id')->on('chatter_categories')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
            $table->bigInteger('user_id')->unsigned()->index();
            $table->foreign('user_id')->references('id')->on('users')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
        });
        Schema::table('chatter_post', function (Blueprint $table) {
            $table->integer('chatter_discussion_id')->unsigned()->index();
            $table->foreign('chatter_discussion_id')->references('id')->on('chatter_discussion')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
            $table->bigInteger('user_id')->unsigned()->index();
            $table->foreign('user_id')->references('id')->on('users')
                        ->onDelete('cascade')
                        ->onUpdate('cascade');
        });
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire