diff options
author | Steinar H. Gunderson <sgunderson@bigfoot.com> | 2014-04-06 11:50:10 +0200 |
---|---|---|
committer | Steinar H. Gunderson <sgunderson@bigfoot.com> | 2014-04-06 11:50:10 +0200 |
commit | 64e1dab38b26b32c1e53605a0788b7ad49d2af09 (patch) | |
tree | 1479b075a512833e79b714b82e2b5f74eba3113b | |
parent | b7a93569f3616ff9c24a1cf799b6a9389b323d5f (diff) |
Make it slightly easier to create a new SQL database, since we do not hard-code database names.
-rw-r--r-- | sql/nms.sql | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/sql/nms.sql b/sql/nms.sql index 881e19a..bd695e1 100644 --- a/sql/nms.sql +++ b/sql/nms.sql @@ -1,40 +1,4 @@ -- --- PostgreSQL database cluster dump --- - -\connect postgres - -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; - --- --- Roles --- - -CREATE ROLE nms; -ALTER ROLE nms WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION PASSWORD '<removed>'; -CREATE ROLE postgres; -ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION; - - - - - - --- --- Database creation --- - -CREATE DATABASE nms WITH TEMPLATE = template0 OWNER = nms; -REVOKE ALL ON DATABASE template1 FROM PUBLIC; -REVOKE ALL ON DATABASE template1 FROM postgres; -GRANT ALL ON DATABASE template1 TO postgres; -GRANT CONNECT ON DATABASE template1 TO PUBLIC; - - -\connect nms - --- -- PostgreSQL database dump -- |