--
-- PostgreSQL database cluster dump
--

SET default_transaction_read_only = off;


--
-- Roles
--

CREATE ROLE amapp;
ALTER ROLE amapp WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5eed6fc392fbef028d0d5f600a63fc7e2';
CREATE ROLE biomart;
ALTER ROLE biomart WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md50236af8d61d2adb5ab395322ff61ec59';
CREATE ROLE biomart_stage;
ALTER ROLE biomart_stage WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md51e1f2bc98b6401e05edea05523be6a3d';
CREATE ROLE biomart_user;
ALTER ROLE biomart_user WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md543d188f334e936d7c84284ba0e6e3985';
CREATE ROLE deapp;
ALTER ROLE deapp WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md56893c3ebe2ca05c87052619d1e006894';
CREATE ROLE fmapp;
ALTER ROLE fmapp WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md52721e6a84c87c5859d76174d2331efd8';
CREATE ROLE galaxy;
ALTER ROLE galaxy WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5feade312f82b850e646b3671c99acb28';
CREATE ROLE i2b2demodata;
ALTER ROLE i2b2demodata WITH SUPERUSER INHERIT NOCREATEROLE CREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md524f0005c591ded7fdea0f423277a208b';
CREATE ROLE i2b2metadata;
ALTER ROLE i2b2metadata WITH SUPERUSER INHERIT NOCREATEROLE CREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5ba6e58d9502a3d6e4408e9d0538d1632';
CREATE ROLE searchapp;
ALTER ROLE searchapp WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md544dcc093141b5e1cfcdc6232c560da01';
CREATE ROLE tm_cz;
ALTER ROLE tm_cz WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5b1cbce950ddc93c5ccec424c0c19a29d';
CREATE ROLE tm_lz;
ALTER ROLE tm_lz WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5f5fb4487b17dbf2f090d87b91670f53f';
CREATE ROLE tm_wz;
ALTER ROLE tm_wz WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5ecb88cc49310482090fe9243436fc73b';
CREATE ROLE ts_batch;
ALTER ROLE ts_batch WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS;
ALTER ROLE biomart_user SET search_path TO 'biomart_user', 'searchapp', 'biomart', 'deapp', 'i2b2demodata', 'i2b2metadata', 'amapp', 'fmapp', 'galaxy', 'public';
ALTER ROLE tm_cz SET search_path TO '$user', 'tm_wz', 'tm_lz', 'deapp', 'i2b2metadata', 'i2b2demodata', 'deapp', 'biomart', 'ts_batch';




--
-- Tablespaces
--
REVOKE ALL ON TABLESPACE transmart FROM PUBLIC;
REVOKE ALL ON TABLESPACE transmart FROM postgres;
REVOKE ALL ON TABLESPACE indx FROM PUBLIC;
REVOKE ALL ON TABLESPACE indx FROM postgres;
GRANT ALL ON TABLESPACE transmart TO tm_cz;
GRANT ALL ON TABLESPACE indx TO tm_cz;


--
-- Create transmart DB
--

CREATE DATABASE transmart WITH TEMPLATE = template0 OWNER = postgres;

--
-- PostgreSQL database cluster dump complete
--
