summaryrefslogtreecommitdiff
path: root/db/migrations/0001.sql
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-03-29 22:29:56 -0400
committerFreya Murphy <freya@freyacat.org>2024-03-29 22:29:56 -0400
commit944b6b0526032ad8c1b4a2612d6723bec75e0e4c (patch)
treed3da5584df33a7878c087622b4fc2ec2883cf880 /db/migrations/0001.sql
downloadxssbook2-944b6b0526032ad8c1b4a2612d6723bec75e0e4c.tar.gz
xssbook2-944b6b0526032ad8c1b4a2612d6723bec75e0e4c.tar.bz2
xssbook2-944b6b0526032ad8c1b4a2612d6723bec75e0e4c.zip
start database (user and post), and initial barebones home page
Diffstat (limited to 'db/migrations/0001.sql')
-rw-r--r--db/migrations/0001.sql17
1 files changed, 17 insertions, 0 deletions
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;