-- Quick fix: sets every existing category to use group id 3 ("Direct & Tunnel"),
-- confirmed via GET /api/user/<username> → "group_ids": [3] on an already-working account.
-- This unblocks purchases immediately, regardless of whether the bot's admin account
-- has "groups.read" permission on the panel yet.
--
-- Longer-term: grant the "Groups: Read" permission to this bot's admin account inside
-- the panel (Admins → the admin used for the bot's userpass login → permissions). Once
-- granted, you can leave pg_group_ids empty for new categories and the bot will
-- automatically fetch + apply ALL panel groups on every purchase (see pg_get_all_group_ids
-- in includes/pasarguard.php) — useful if you add more groups later.
UPDATE categories SET pg_group_ids = '3' WHERE pg_group_ids IS NULL OR pg_group_ids = '';
