<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::statement("ALTER TABLE media DROP CONSTRAINT IF EXISTS media_collection_check");
        DB::statement("ALTER TABLE media ADD CONSTRAINT media_collection_check CHECK (collection IN (
            'academy_logo', 'academy_cover', 'activity_photo', 'branch_photo',
            'gallery', 'team_photo', 'testimonial_avatar', 'partner_logo',
            'news_image', 'section_image', 'general',
            'event_cover', 'event_gallery'
        ))");
    }

    public function down(): void
    {
        DB::statement("ALTER TABLE media DROP CONSTRAINT IF EXISTS media_collection_check");
        DB::statement("ALTER TABLE media ADD CONSTRAINT media_collection_check CHECK (collection IN (
            'academy_logo', 'academy_cover', 'activity_photo', 'branch_photo',
            'gallery', 'team_photo', 'testimonial_avatar', 'partner_logo',
            'news_image', 'section_image', 'general'
        ))");
    }
};
