-- Add official_account_id to categories table ALTER TABLE public.categories ADD COLUMN IF NOT EXISTS official_account_id UUID REFERENCES public.profiles(id); -- Create index for faster lookups CREATE INDEX IF NOT EXISTS idx_categories_official_account ON public.categories(official_account_id) WHERE official_account_id IS NOT NULL;