0

I wonder if a mysql table can have two columns that is FK and proints to the same PK in another table like this:

Table conversations:

          $table->increments('con_id');
          $table->string('subject', 45);
          $table->integer('sender_id')->unsigned()->index();
          $table->integer('recipient_id')->unsigned()->index();
          $table->foreign('sender_id')->references('user_id')->on('users')->onDelete('cascade');
          $table->foreign('recipient_id')->references('user_id')->on('users')->onDelete('cascade');
user2722667
  • 8,195
  • 14
  • 52
  • 100

0 Answers0