-- Grant SELECT permissions for Grafana user on flattened views
GRANT SELECT ON account_insights_flattened TO grafana;
GRANT SELECT ON campaign_insights_flattened TO grafana;
GRANT SELECT ON adset_insights_flattened TO grafana;

-- Grant SELECT on all existing tables and views in the schema
GRANT SELECT ON ALL TABLES IN SCHEMA public TO grafana;

-- Grant SELECT on all future tables and views in the schema
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO grafana;
