<?php

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

class CreateControlSectionHistoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('control_section_history', function (Blueprint $table) {
            $table->string('id')->primary();
            $table->string('control_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('section_type_id', 'FK_1894d9d7e53bae241f1e731e1f5')->references('id')->on('section_type');
            $table->foreign('control_history_id', 'FK_295cb332b93182949d57a20359d')->references('id')->on('control_history');
        });
    }

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