-- Create event_categories enum
CREATE TYPE event_category AS ENUM (
  'music_concerts',
  'festivals',
  'parties_nightlife',
  'sports',
  'theatre_performing_arts',
  'comedy_shows',
  'workshops_classes',
  'conferences_seminars',
  'food_drink_events',
  'family_kids',
  'cultural_community',
  'religious_faith',
  'charity_fundraisers',
  'business_networking',
  'car_bike_shows',
  'fashion_beauty',
  'gaming_esports',
  'film_entertainment',
  'adventure_outdoor',
  'holiday_seasonal',
  'carnival_parade'
);

-- Add category columns to events table
ALTER TABLE events 
ADD COLUMN IF NOT EXISTS primary_category event_category,
ADD COLUMN IF NOT EXISTS secondary_categories event_category[] DEFAULT '{}';

-- Create index for better query performance
CREATE INDEX IF NOT EXISTS idx_events_primary_category ON events(primary_category);
CREATE INDEX IF NOT EXISTS idx_events_secondary_categories ON events USING GIN (secondary_categories);

-- Add comment for documentation
COMMENT ON COLUMN events.primary_category IS 'Primary category for the event (required)';
COMMENT ON COLUMN events.secondary_categories IS 'Optional secondary categories for the event';
