diff --git a/services/migrations/migrations/00001_create.sql b/services/migrations/migrations/00001_create.sql index ed35486..344918c 100644 --- a/services/migrations/migrations/00001_create.sql +++ b/services/migrations/migrations/00001_create.sql @@ -4,8 +4,8 @@ CREATE schema api; -- authenticator is the role which can "impersonate" other users. CREATE ROLE authenticator LOGIN NOINHERIT NOCREATEDB NOCREATEROLE NOSUPERUSER; --- anon is the role assigned to anon web requests -CREATE ROLE anon NOLOGIN; +-- web_anon is the role assigned to anonymous web requests +CREATE ROLE web_anon NOLOGIN; -- schema for @futureporn/capture and @futureporn/bot CREATE TABLE api.discord_interactions ( @@ -21,7 +21,6 @@ GRANT automation TO authenticator; GRANT usage ON SCHEMA api TO automation; GRANT all ON api.discord_interactions TO automation; --- role & permissions for anon web user -CREATE ROLE anon NOLOGIN; -GRANT usage on schema api TO anon; -GRANT SELECT ON api.discord_interactions TO anon; +-- role & permissions for web_anon web user +GRANT usage on schema api TO web_anon; +GRANT SELECT ON api.discord_interactions TO web_anon; diff --git a/services/migrations/migrations/00002_add-records-table.sql b/services/migrations/migrations/00002_add-records-table.sql index e3fc429..7f95c3f 100644 --- a/services/migrations/migrations/00002_add-records-table.sql +++ b/services/migrations/migrations/00002_add-records-table.sql @@ -8,3 +8,4 @@ CREATE TABLE api.records ( -- roles & permissions for our backend automation user GRANT all ON api.records TO automation; +GRANT SELECT ON api.discord_interactions TO web_anon; \ No newline at end of file diff --git a/services/migrations/package.json b/services/migrations/package.json index 53a21cc..dade322 100644 --- a/services/migrations/package.json +++ b/services/migrations/package.json @@ -1,7 +1,7 @@ { "name": "@futureporn/migrations", "type": "module", - "version": "0.1.0", + "version": "0.1.1", "description": "", "main": "index.js", "scripts": {