<?php

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

class CreateCasesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cases', function (Blueprint $table) {
            $table->increments('id');
            $table->string('slug')->nullable();
            $table->integer('pid')->nullable();
            $table->tinyInteger('recom')->default(0);
            $table->tinyInteger('headline')->default(0);
            $table->tinyInteger('top')->default(0);
            $table->integer('hits');
            $table->integer('orders');
            $table->string('linkurl')->nullable();
            $table->boolean('flag')->default(1);
            $table->timestamps();
        });

        Schema::create('case_descriptions', function (Blueprint $table) {
            $table->increments('id');
            $table->char('lang', 10)->index();
            $table->integer('case_id');
            $table->string('title');
            $table->text('summary')->nullable();
            $table->longText('content')->nullable();
            $table->string('seo_title')->nullable();
            $table->string('seo_keywords')->nullable();
            $table->text('seo_description')->nullable();
            $table->text('imgs')->nullable();
        });

    }

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