-
Notifications
You must be signed in to change notification settings - Fork 14
/
001_schemas_and_roles.sql
37 lines (28 loc) · 1.5 KB
/
001_schemas_and_roles.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
CREATE SCHEMA IF NOT EXISTS INTERNAL_REPORTING;
CREATE SCHEMA IF NOT EXISTS INTERNAL_REPORTING_MV;
-- Python UDFs and procedures may only import code when in a versioned schema
CREATE OR ALTER VERSIONED SCHEMA INTERNAL_PYTHON;
CREATE APPLICATION ROLE IF NOT EXISTS ADMIN;
CREATE APPLICATION ROLE IF NOT EXISTS READ_ONLY;
CREATE APPLICATION ROLE IF NOT EXISTS PUBLIC_;
CREATE APPLICATION ROLE IF NOT EXISTS SUNDECK_SERVICE_ROLE;
CREATE SCHEMA IF NOT EXISTS ACCOUNT_USAGE;
CREATE SCHEMA IF NOT EXISTS ORGANIZATION_USAGE;
CREATE SCHEMA IF NOT EXISTS TASKS;
GRANT USAGE ON SCHEMA TASKS TO APPLICATION ROLE ADMIN;
CREATE OR ALTER VERSIONED SCHEMA CATALOG;
GRANT USAGE ON SCHEMA CATALOG TO APPLICATION ROLE ADMIN;
GRANT USAGE ON SCHEMA CATALOG TO APPLICATION ROLE READ_ONLY;
GRANT USAGE ON SCHEMA CATALOG TO APPLICATION ROLE SUNDECK_SERVICE_ROLE;
CREATE OR ALTER VERSIONED SCHEMA TOOLS;
GRANT USAGE ON SCHEMA TOOLS TO APPLICATION ROLE ADMIN;
GRANT USAGE ON SCHEMA TOOLS TO APPLICATION ROLE READ_ONLY;
GRANT USAGE ON SCHEMA TOOLS TO APPLICATION ROLE PUBLIC_;
CREATE OR ALTER VERSIONED SCHEMA REPORTING;
GRANT USAGE ON SCHEMA REPORTING TO APPLICATION ROLE ADMIN;
GRANT USAGE ON SCHEMA REPORTING TO APPLICATION ROLE READ_ONLY;
GRANT USAGE ON SCHEMA REPORTING TO APPLICATION ROLE SUNDECK_SERVICE_ROLE;
CREATE OR ALTER VERSIONED SCHEMA ADMIN;
GRANT USAGE ON SCHEMA ADMIN TO APPLICATION ROLE ADMIN;
GRANT USAGE ON SCHEMA ADMIN TO APPLICATION ROLE SUNDECK_SERVICE_ROLE;
create view catalog.config if not exists as select * from internal.config;