From 944b6b0526032ad8c1b4a2612d6723bec75e0e4c Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 29 Mar 2024 22:29:56 -0400 Subject: start database (user and post), and initial barebones home page --- db/migrations/0001.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 db/migrations/0001.sql (limited to 'db/migrations/0001.sql') diff --git a/db/migrations/0001.sql b/db/migrations/0001.sql new file mode 100644 index 0000000..d20d895 --- /dev/null +++ b/db/migrations/0001.sql @@ -0,0 +1,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; -- cgit v1.2.3-freya