-- Extend SocialPlatform enum with JSN-side handle types
ALTER TYPE "SocialPlatform" ADD VALUE IF NOT EXISTS 'facebook';
ALTER TYPE "SocialPlatform" ADD VALUE IF NOT EXISTS 'threads';
ALTER TYPE "SocialPlatform" ADD VALUE IF NOT EXISTS 'bluesky';
ALTER TYPE "SocialPlatform" ADD VALUE IF NOT EXISTS 'linkedin';

-- One row per (user, platform) — enforces idempotency for the JSN bridge sync.
CREATE UNIQUE INDEX IF NOT EXISTS "uniq_user_social_link_user_platform"
  ON "user_social_links"("user_id", "platform");
