bigIncrements('id'); $table->string('content'); $table->unsignedBigInteger('poster_id')->nullable(); $table->unsignedBigInteger('thread_id'); $table->timestamps(); //Key constraints $table->foreign('poster_id')-> references('id')-> on('users')-> onDelete('set null'); $table->foreign('thread_id')-> references('id')-> on('threads')-> onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('posts'); } }