summaryrefslogtreecommitdiff
path: root/sql/superuser_init.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/superuser_init.sql')
-rw-r--r--sql/superuser_init.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/superuser_init.sql b/sql/superuser_init.sql
new file mode 100644
index 00000000..6e94167c
--- /dev/null
+++ b/sql/superuser_init.sql
@@ -0,0 +1,15 @@
+-- This script should be run before all other scripts and as a PostgreSQL
+-- superuser. It will create the VNDB database and required users.
+-- All other SQL scripts should be run by the 'vndb' user.
+
+-- In order to "activate" a user, i.e. to allow login, you need to manually run
+-- the following for each user you want to activate:
+-- ALTER ROLE rolename LOGIN PASSWORD 'password';
+
+CREATE ROLE vndb;
+CREATE DATABASE vndb OWNER vndb;
+
+-- The website
+CREATE ROLE vndb_site;
+-- Multi
+CREATE ROLE vndb_multi;