<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('lookup_lists', function (Blueprint $table) {
            $table->id();
            $table->tinyInteger('farm_id')->default(1);
            $table->string('list_type');
            $table->string('value');
            $table->string('label');
            $table->smallInteger('sort_order')->default(0);
            $table->boolean('is_active')->default(true);
            $table->timestamps();

            $table->index(['farm_id', 'list_type']);
            $table->unique(['farm_id', 'list_type', 'value']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('lookup_lists');
    }
};
