2021_05_11_094828_create_dictionaries_table.php 970 Bytes
<?php

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

class CreateDictionariesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('dictionaries', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('region_id')->unique();
            $table->bigInteger('parent_id')->nullable();
            $table->string('name', 255);
            $table->string('type', 255);
            $table->bigInteger('token_id')->nullable();
            $table->boolean('update')->default(1);
            $table->timestamps();

            $table->foreign('token_id')->references('id')->on('tokens');
        });
    }

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