<?php

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

class AddMultilangCodeEmbedColumns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('code_embeds', function (Blueprint $table) {
            $table->dateTime('updated_at', 0)->nullable()->default(null)->change();
            $table->mediumText('code')->nullable(true)->change();
            $table->string('type', 20)->default('single_lang');
        });

        Schema::table('code_embeds_lang', function (Blueprint $table) {
            $table->mediumText('code_lang')->nullable(true);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('code_embeds', function (Blueprint $table) {
            $table->dropColumn('type');
        });

        Schema::table('code_embeds_lang', function (Blueprint $table) {
            $table->dropColumn('code_lang');
        });
    }
}
