<?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::table('catalog_items', function (Blueprint $table): void {
            $table->dropColumn('ticket_generation_policy');
        });
    }

    public function down(): void
    {
        Schema::table('catalog_items', function (Blueprint $table): void {
            $table->enum('ticket_generation_policy', ['one_per_unit'])
                ->default('one_per_unit')
                ->after('has_tickets');
        });
    }
};
