summaryrefslogtreecommitdiff
path: root/src/db/migrations/0001.sql
blob: d20d895922dc82fbdedfd7553a8005b51596d0ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
BEGIN TRANSACTION;
SET search_path = public;

-- Migration Start
CREATE ROLE authenticator LOGIN NOINHERIT NOCREATEDB NOCREATEROLE NOSUPERUSER;
-- scary, make sure the db is not public!!!
ALTER ROLE authenticator WITH PASSWORD 'postgrest';
CREATE ROLE rest_anon NOLOGIN;
CREATE ROLE rest_user NOLOGIN;
GRANT rest_anon TO authenticator;
GRANT rest_user TO authenticator;
-- Migration End;

-- Set Current Revision
UPDATE sys.database_info SET curr_revision = 2 WHERE name = current_database();

COMMIT TRANSACTION;