-- Add moderation_preferences column to user_preferences table
-- This stores moderator UI preferences like detailed view collapsed state

ALTER TABLE public.user_preferences 
ADD COLUMN IF NOT EXISTS moderation_preferences JSONB NOT NULL DEFAULT '{}'::jsonb;

COMMENT ON COLUMN public.user_preferences.moderation_preferences IS 
  'Stores moderator UI preferences like detailed view collapsed state';

-- Add GIN index for efficient JSONB queries
CREATE INDEX IF NOT EXISTS idx_user_preferences_moderation_prefs 
ON public.user_preferences USING gin(moderation_preferences);