-- Migration 022: Directory Privacy Settings
-- Adds privacy controls for member directory visibility

-- Add directory_privacy JSONB column to members table
ALTER TABLE public.members
ADD COLUMN IF NOT EXISTS directory_privacy JSONB DEFAULT '{
  "show_email": true,
  "show_phone": true,
  "show_address": false,
  "show_nationality": true
}'::jsonb;

-- Add comment
COMMENT ON COLUMN public.members.directory_privacy IS 'Controls which fields are visible in the member directory. Admins always see all fields.';
