<?php

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

class CreateQuestionAnswerFeedbacksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('question_answer_feedbacks', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('question_answer_id');
            $table->unsignedBigInteger('user_id');
            $table->integer('status')->default(1);

            $table->foreign('user_id')->references('id')->on('admins');
            $table->foreign('question_answer_id')->references('id')->on('question_answers');
        });
    }

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