-- Phase 7.11 - Give all current users access to Customers Report Offline
-- Run in Cloudflare D1 Console if non-admin users should see the new section.

INSERT OR IGNORE INTO permissions (user_id, section_key, can_view, can_refresh, can_manage)
SELECT id, 'customer_report_by_day', 1, 0, 0
FROM users;

UPDATE permissions
SET can_view = 1
WHERE section_key = 'customer_report_by_day'
AND user_id IN (SELECT id FROM users);
