<?php

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

class CreateBoardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(!Schema::hasTable('boards')) {
            Schema::create('boards', function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->bigInteger('user_id');
                $table->string('name')->nullable();
                $table->text('description')->nullable();
                $table->longText('data')->nullable();
                $table->string('public', 45)->nullable();
                $table->string('height', 45)->nullable();
                $table->string('width', 45)->nullable();
                $table->timestamps();
                $table->softDeletes();
                $table->binary('thumb')->nullable();
                $table->string('readonly', 45)->nullable();
                $table->text('state')->nullable();
                $table->string('is_template', 45)->nullable();
                $table->string('paid', 45)->nullable();
                $table->string('favourite', 45)->nullable();
                $table->integer('board_folder_id')->nullable();
                $table->integer('order')->nullable();
            });
        }
    }

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