<?php

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

class CreateCopypastdeconfiguracoesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('copypastdeconfiguracoes', function (Blueprint $table) {
            $table->id();
            $table->string('titulo');
            $table->enum('tipo',['copy','past'])->default('copy');
            $table->enum('estado',['visualizado','naovisualizado'])->default('naovisualizado');
            $table->text('corpo');
            $table->foreignId('user_id');
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('copypastdeconfiguracoes', function(Blueprint $table)
        {
            $table->dropSoftDeletes();
        });
        Schema::dropIfExists('copypastdeconfiguracoes');
    }
}
