<?php

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

class CreateFormsEntrancesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('forms_entrances', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger("form_id");
            $table->json("values");
            $table->string("status")->default("not_accepted");
            $table->timestamps();
            $table->foreign("form_id")
                ->references("id")
                ->on("forms")
                ->onDelete('cascade')
            ;
        });
    }

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