-- Add privacy settings to profiles if they don't exist
ALTER TABLE public.profiles 
ADD COLUMN IF NOT EXISTS is_private BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN IF NOT EXISTS is_official BOOLEAN NOT NULL DEFAULT false;

-- Add status column to follows for request logic
ALTER TABLE public.follows 
ADD COLUMN IF NOT EXISTS status TEXT NOT NULL DEFAULT 'accepted';

-- Add check constraint to ensure valid status values
DO $$ 
BEGIN 
    IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'follows_status_check') THEN 
        ALTER TABLE public.follows 
        ADD CONSTRAINT follows_status_check CHECK (status IN ('pending', 'accepted')); 
    END IF; 
END $$;
