<?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('versions', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->string('version');
            $table->string('name');
            $table->text('changelog')->nullable();
            $table->enum('status', ['draft', 'beta', 'live', 'rollback'])->default('draft');
            $table->enum('platform', ['all', 'web', 'app'])->default('all');
            $table->boolean('show_popup')->default(true);
            $table->timestamp('released_at')->nullable();
            $table->timestamps();
        });
    }

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