
 -- Role: "BILLING_USER"
-- DROP ROLE "BILLING_USER";

CREATE ROLE "BILLING_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'BILLING_USER';
 
-- Role: "COLLECTION_USER"
-- DROP ROLE "COLLECTION_USER";
 CREATE ROLE "COLLECTION_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'COLLECTION_USER';
 
 -- Role: "ORDERS_USER"
-- DROP ROLE "ORDERS_USER";

CREATE ROLE "ORDERS_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'ORDERS_USER';
  
-- Role: "CRM_USER"
-- DROP ROLE "CRM_USER";

CREATE ROLE "CRM_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'CRM_USER';

-- Role: "TAR_BILLING_USER"
-- DROP ROLE "TAR_BILLING_USER";

CREATE ROLE "TAR_BILLING_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'TAR_BILLING_USER';
 
 -- Role: "TAR_COLLECTION_USER"
-- DROP ROLE "TAR_COLLECTION_USER";

CREATE ROLE "TAR_COLLECTION_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'TAR_COLLECTION_USER';
 
 -- Role: "TAR_ORDERING_USER"
-- DROP ROLE "TAR_ORDERING_USER";

CREATE ROLE "TAR_ORDERING_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'TAR_ORDERING_USER';
  
  -- Role: "TAR_CRM_USER"
-- DROP ROLE "TAR_CRM_USER";

-- Role: "TAR_CRM_USER"
-- DROP ROLE "TAR_CRM_USER";

CREATE ROLE "TAR_CRM_USER" WITH
  LOGIN
  SUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  NOREPLICATION
  PASSWORD 'TAR_CRM_USER';
 
 -- Database: BILLING_DB

-- DROP DATABASE "BILLING_DB";

CREATE DATABASE "BILLING_DB"
    WITH 
    OWNER = "BILLING_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
   
   -- Database: COLLECTION_DB

-- DROP DATABASE "COLLECTION_DB";

CREATE DATABASE "COLLECTION_DB"
    WITH 
    OWNER = "COLLECTION_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
   
   -- Database: ORDERING_DB

-- DROP DATABASE "ORDERING_DB";

CREATE DATABASE "ORDERING_DB"
    WITH 
    OWNER = "ORDERS_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
   
   -- Database: TAR_BILLING_DB

-- DROP DATABASE "TAR_BILLING_DB";

CREATE DATABASE "TAR_BILLING_DB"
    WITH 
    OWNER = "TAR_BILLING_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
   
   -- Database: TAR_COLLECTION

-- DROP DATABASE "TAR_COLLECTION";

CREATE DATABASE "TAR_COLLECTION"
    WITH 
    OWNER = "TAR_COLLECTION_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
   
   -- Database: TAR_ORDERING

-- DROP DATABASE "TAR_ORDERING";

CREATE DATABASE "TAR_ORDERING"
    WITH 
    OWNER = "TAR_ORDERING_USER"
    ENCODING = 'UTF8'
    CONNECTION LIMIT = -1;
	
	-- Database: CRM_DB

-- DROP DATABASE "CRM_DB";

CREATE DATABASE "CRM_DB"
    WITH 
    OWNER = "CRM_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;

-- Database: TAR_CRM_DB

-- DROP DATABASE "TAR_CRM_DB";

CREATE DATABASE "TAR_CRM_DB"
    WITH 
    OWNER = "TAR_CRM_USER"
    ENCODING = 'UTF8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
