ALTER TABLE "users" ADD COLUMN "is_developer" boolean DEFAULT false NOT NULL;
--> statement-breakpoint
-- Grandfather in anyone who already has a webhook, API key, or BYOK AI
-- key configured -- this column ships as a new access gate on those three
-- features, and without this backfill every existing integration would
-- silently break the moment this migration runs.
UPDATE "users" SET "is_developer" = true WHERE "id" IN (
	SELECT "user_id" FROM "webhooks"
	UNION
	SELECT "user_id" FROM "api_keys"
	UNION
	SELECT "user_id" FROM "user_ai_keys"
);