<?php

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

class CreateLocalesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('locales', function (Blueprint $table) {
            $table->id();
            $table->char('uuid', 36)->index()->unique();
            $table->string('name', 20)->nullable()->index();
            $table->string('name_iso', 20)->nullable()->index();
            $table->string('title')->nullable()->index();
            $table->boolean('rtl')->default(0)->index();
            $table->boolean('is_enabled')->default(0)->index();
            $table->boolean('is_default')->default(0)->index();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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