<?php

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

class CreatePageDescriptionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('page_descriptions', function (Blueprint $table) {
            $table->id();
            $table->string('why_us_title', 100)->nullable();
            $table->string('why_us_experience_years_title', 100)->nullable();
            $table->string('about_us_overview_title', 100)->nullable();
            $table->string('about_us_social_responsibility_title', 100)->nullable();
            $table->string('about_us_company_strategy_title', 100)->nullable();
            $table->string('vision_title', 100)->nullable();
            $table->string('message_title', 100)->nullable();
            $table->string('values_title', 100)->nullable();
            $table->string('culture_values_title', 100)->nullable();
            $table->string('performance_development_title', 100)->nullable();
            $table->longText('why_us_description')->nullable();
            $table->longText('about_us_overview_description')->nullable();
            $table->longText('about_us_social_responsibility_description')->nullable();
            $table->longText('about_us_company_strategy_description')->nullable();
            $table->longText('vision_description')->nullable();
            $table->longText('message_description')->nullable();
            $table->longText('values_description')->nullable();
            $table->longText('culture_values_description')->nullable();
            $table->longText('performance_development_description')->nullable();

            $table->unsignedBigInteger('page_id')->index();
            $table->unsignedBigInteger('language_id')->index();

            $table->foreign('page_id')->references('id')->on('pages')->cascadeOnDelete();
            $table->engine = 'InnoDB';
        });
    }

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