<?php

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

class AddLocaleToImportsExportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('imports', function (Blueprint $table) {
            $table->enum('locale', ['en', 'ru', 'tm'])
                ->default('tm')
                ->index()
                ->after('registered_at');
        });

        Schema::table('exports', function (Blueprint $table) {
            $table->enum('locale', ['en', 'ru', 'tm'])
                ->default('tm')
                ->index()
                ->after('is_line');
        });
    }

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

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