<?php

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

class CreateMenuPagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('status', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();
        });

        Schema::create('menu_pages', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title_ba');
            $table->string('title_en')->nullable();
            $table->text('description_ba');
            $table->text('description_en')->nullable();
            $table->text('content_ba');
            $table->text('content_en')->nullable();
            $table->string('slug');
            $table->bigInteger('pid');
            $table->string('link');
            $table->string('image')->nullable();
            $table->text('widget_content_ba')->nullable();
            $table->text('widget_content_en')->nullable();
            $table->integer('status_id')->unsigned();
           // $table->foreign('status_id')->references('id')->on('status');
            $table->bigInteger('created_by')->unsigned();
            $table->bigInteger('updated_by')->unsigned();
            $table->foreign('created_by')->references('id')->on('users');
            $table->foreign('updated_by')->references('id')->on('users');
            $table->timestamps();
        });


    }

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