<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        DB::statement("ALTER TABLE expenses DROP CONSTRAINT IF EXISTS expenses_category_check");
        DB::statement("ALTER TABLE expenses ADD CONSTRAINT expenses_category_check CHECK (category IN ('maintenance', 'supplies', 'transport', 'food_beverage', 'sports_equipment', 'printing', 'cleaning', 'medical', 'utilities', 'other', 'external_revenue'))");
    }

    public function down(): void
    {
        DB::statement("ALTER TABLE expenses DROP CONSTRAINT IF EXISTS expenses_category_check");
        DB::statement("ALTER TABLE expenses ADD CONSTRAINT expenses_category_check CHECK (category IN ('maintenance', 'supplies', 'transport', 'food_beverage', 'sports_equipment', 'printing', 'cleaning', 'medical', 'utilities', 'other'))");
    }
};
