<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNotificationsReciverTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('notifications_reciver', function (Blueprint $table) {
            $table->bigIncrements('id');

            $table->unsignedBigInteger('notification_id');
            $table->foreign('notification_id')->references('id')->on('notification')->onDelete('cascade');

            $table->unsignedBigInteger('reciver_id');
            $table->foreign('reciver_id')->references('id')->on('users')->onDelete('cascade');
          
            $table->timestamps();
        });
    }

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