-- Allow anonymous users to INSERT usage tracking events
-- This is needed because the tracking endpoint doesn't require auth

-- Allow anon to INSERT (for tracking from frontend)
CREATE POLICY "Allow anonymous tracking inserts"
  ON usage_events FOR INSERT TO anon
  WITH CHECK (true);

-- Allow authenticated users to INSERT as well
CREATE POLICY "Allow authenticated tracking inserts"
  ON usage_events FOR INSERT TO authenticated
  WITH CHECK (true);

-- Reads should still be restricted to service_role (already set up)
