ALTER TABLE "events" ADD COLUMN "color" text;

UPDATE "events" AS e
SET "color" = COALESCE(t."calendarConfig"->'quickEntry'->>'color', '#2563eb')
FROM "tenants" AS t
WHERE e."tenant" = t."id"
  AND e."quick" = true
  AND e."color" IS NULL;
