<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('countries', function (Blueprint $table) {
            $table->id();
            $table->string('common_name'); // Ülkenin yaygın adı
            $table->string('native_name')->nullable(); // Ülkenin yerel adı
            $table->string('a2_iso', 2)->unique(); // 2 harfli ISO kodu
            $table->string('a3_iso', 3)->unique(); // 3 harfli ISO kodu
            $table->unsignedInteger('default_currency_id')->nullable(); // Varsayılan para birimi
            $table->unsignedInteger('capital_id')->nullable(); // Başkent
            $table->string('region')->nullable(); // Bölge
            $table->string('subregion')->nullable(); // Alt bölge
            $table->unsignedInteger('default_language_id')->nullable(); // Varsayılan dil
            $table->string('coordinates')->nullable(); // Koordinatlar
            $table->timestamps();
        });
    }

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