<?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::table('galleries', function (Blueprint $table): void {
            $table->boolean('upload_enabled')->default(false)->after('access_duration_minutes');
            $table->string('upload_token_hash')->nullable()->after('upload_enabled');
            $table->timestamp('upload_token_expires_at')->nullable()->after('upload_token_hash');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('galleries', function (Blueprint $table): void {
            $table->dropColumn([
                'upload_enabled',
                'upload_token_hash',
                'upload_token_expires_at',
            ]);
        });
    }
};
