diff --git a/scripts/obrand.sql b/scripts/obrand.sql new file mode 100644 index 0000000..a0fc7dc --- /dev/null +++ b/scripts/obrand.sql @@ -0,0 +1,35 @@ +-- Database: "oBrand" + +DROP DATABASE "oBrand"; + +-- Role: obrand + +DROP ROLE obrand; + +CREATE ROLE obrand LOGIN + ENCRYPTED PASSWORD 'md51e16472d06fb312d14e3001f44e9460e' + NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; + +CREATE DATABASE "oBrand" + WITH OWNER = postgres + ENCODING = 'UTF8' + TABLESPACE = pg_default + LC_COLLATE = 'C' + LC_CTYPE = 'C' + CONNECTION LIMIT = -1; +GRANT ALL ON DATABASE "oBrand" TO postgres; + + +GRANT CONNECT ON DATABASE "oBrand" TO obrand; +REVOKE ALL ON DATABASE "oBrand" FROM public; + +ALTER DEFAULT PRIVILEGES + GRANT INSERT, SELECT, UPDATE ON TABLES + TO public; + +ALTER DEFAULT PRIVILEGES + GRANT INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON TABLES + TO postgres; + + +