show roles;

create role default_role;

-- PROD
GRANT USAGE ON DATABASE suno_prod TO ROLE default_role;
GRANT USAGE ON SCHEMA suno_prod.prod TO ROLE default_role;
GRANT SELECT ON ALL TABLES IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT SELECT ON ALL VIEWS IN SCHEMA suno_prod.prod TO ROLE default_role;

GRANT SELECT ON FUTURE TABLES IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT SELECT ON FUTURE VIEWS IN SCHEMA suno_prod.prod TO ROLE default_role;

GRANT MONITOR ON ALL TASKS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT OPERATE ON ALL TASKS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON ALL FILE FORMATS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON ALL FUNCTIONS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON ALL PROCEDURES IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON ALL GIT REPOSITORIES IN SCHEMA suno_prod.prod TO ROLE default_role;


GRANT MONITOR ON FUTURE TASKS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT OPERATE ON FUTURE TASKS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON FUTURE FILE FORMATS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON FUTURE FUNCTIONS IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON FUTURE PROCEDURES IN SCHEMA suno_prod.prod TO ROLE default_role;
GRANT USAGE ON FUTURE GIT REPOSITORIES IN SCHEMA suno_prod.prod TO ROLE default_role;


-- STAGING
GRANT USAGE ON DATABASE suno_staging TO ROLE default_role;

GRANT USAGE ON SCHEMA suno_staging.staging TO ROLE default_role;
GRANT SELECT ON ALL TABLES IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT SELECT ON ALL VIEWS IN SCHEMA suno_staging.staging TO ROLE default_role;

GRANT SELECT ON FUTURE TABLES IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT SELECT ON FUTURE VIEWS IN SCHEMA suno_staging.staging TO ROLE default_role;

GRANT MONITOR ON ALL TASKS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT OPERATE ON ALL TASKS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON ALL FILE FORMATS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON ALL FUNCTIONS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON ALL PROCEDURES IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON ALL GIT REPOSITORIES IN SCHEMA suno_staging.staging TO ROLE default_role;

GRANT MONITOR ON FUTURE TASKS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT OPERATE ON FUTURE TASKS IN SCHEMA suno_staging.staging TO ROLE default_role;

GRANT USAGE ON FUTURE FILE FORMATS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON FUTURE FUNCTIONS IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON FUTURE PROCEDURES IN SCHEMA suno_staging.staging TO ROLE default_role;
GRANT USAGE ON FUTURE GIT REPOSITORIES IN SCHEMA suno_staging.staging TO ROLE default_role;