<?php

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

/**
 * Seeded, platform-wide locale (language/region) reference data — see
 * ReferenceDataSeeder. Global, never tenant-scoped, same as `currencies`.
 * Backs the Master Control "Locale" tab's locale Select: a BCP-47 tag (e.g.
 * "en-LK") a landlord picks from a real list rather than types by hand.
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::create('locales', function (Blueprint $table) {
            $table->id();
            $table->string('code', 10)->unique();
            $table->string('name', 100);
            $table->unsignedInteger('sort_order')->default(0);
            $table->timestamps();
        });
    }

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