-- ============================================================================= -- Convivo — per-event Pretix API key -- -- Moves the Pretix API key from a sidecar env var to a per-event column so an -- admin can paste it in the event settings. The sidecar's /pretix-options -- endpoint uses it to list the key's organizers + events (so the admin picks -- the organizer + event slug from real data), and the every-minute sync uses -- it to authenticate. The key is stored in plain text and remains visible in -- the event settings (admin-only column, readable/writable by admin via RLS). -- ============================================================================= alter table public.events add column if not exists pretix_api_key text; comment on column public.events.pretix_api_key is 'Pretix API token for this event. Used by the sidecar to list the key''s ' 'organizers/events (POST /pretix-options) and to authenticate the ' 'every-minute paid-ticket sync. Stored in plain text; visible in the event ' 'settings.';