summaryrefslogtreecommitdiff
path: root/src/db/migrations/0001.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/migrations/0001.sql')
-rw-r--r--src/db/migrations/0001.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/db/migrations/0001.sql b/src/db/migrations/0001.sql
new file mode 100644
index 0000000..d20d895
--- /dev/null
+++ b/src/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;