-- change role to ACCOUNTADMIN
-- create role for lightup
create role if not exists lightup_role;
grant role lightup_role to role SYSADMIN;
-- Note that we are not making the lightup_role; a SYSADMIN,
-- but rather granting users with the SYSADMIN role
-- power to modify the lightup_role.
-- create a user for lightup
create user if not exists lightup_user password = '<enter password here>';
grant role lightup_role to user lightup_user;
alter user lightup_user set default_role = lightup_role;
-- grant read only database access
-- repeat for all database/schemas
grant usage on database <database> to role lightup_role;
grant usage on schema <database>.<schema> to role lightup_role;
-- rerun the following any time a table is added to the schema
grant select on all tables in schema <database>.<schema> to role lightup_role;
grant select on future tables in schema <database>.<schema> to role lightup_role;