<?php

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

class CreateSectionHistoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('section_history', function (Blueprint $table) {
            $table->string('id')->primary();
            $table->string('history_id');
            $table->string('section_type_id');
            $table->string('title', 45)->nullable();
            $table->text('summary')->nullable();
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->nullable();
            
            $table->foreign('history_id', 'FK_82fba69afda1c8f1aa98892dd0c')->references('id')->on('history');
            $table->foreign('section_type_id', 'FK_cfc2a419b1fe9d74f246288b1a4')->references('id')->on('section_type');
        });
    }

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