<?php

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

class CreateTableLookup extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('platform_lookup', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('category');
            $table->string('parent_key')->nullable();
            $table->string('lookup_key');
            $table->string('lookup_value');
            $table->json('meta')->nullable();
            $table->timestamps();

            $table->unique(['category', 'lookup_key']);
        });
    }

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