<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * Platform/marketplace iklan (RPD §3.1): Shopee, Lazada, Website UMKM, dll.
     * countries = comma-separated ISO (ID,MY,PH,TH). is_active=false = coming soon.
     */
    public function up(): void
    {
        Schema::create('ad_platforms', function (Blueprint $table) {
            $table->id();
            $table->string('name', 60);
            $table->string('slug', 60)->unique();
            $table->enum('ad_type', ['affiliate', 'link_website', 'backlink', 'press_release']);
            $table->string('countries', 100)->nullable(); // ID,MY,PH,TH
            $table->boolean('is_active')->default(true);  // false = coming soon
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->timestamps();
        });
    }

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