MyISAM

From Request Tracker Wiki
Jump to navigation Jump to search

-- -- PostgreSQL database cluster dump --

\connect postgres

SET client_encoding = 'UTF8'; SET standard_conforming_strings = off; SET escape_string_warning = 'off';

-- -- Roles --

CREATE ROLE postgres; ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN PASSWORD 'md5e695893ed9afbf52436c0c78832f52f7'; CREATE ROLE root; ALTER ROLE root WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN PASSWORD 'md585c4806ba59bb7416643a14e38a7a069'; CREATE ROLE rt_user; ALTER ROLE rt_user WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN PASSWORD 'md5e5ffbd5626278386cfa50d801ce24517';

-- -- Database creation --

CREATE DATABASE rt3 WITH TEMPLATE = template0 OWNER = postgres ENCODING = 'UTF8'; 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 postgres

-- -- PostgreSQL database dump --

SET client_encoding = 'UTF8'; SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; SET escape_string_warning = off;

-- -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres --

COMMENT ON SCHEMA public IS 'Standard public schema';

-- -- Name: public; Type: ACL; Schema: -; Owner: postgres --

REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC;

-- -- PostgreSQL database dump complete --

\connect rt3

-- -- PostgreSQL database dump --

SET client_encoding = 'UTF8'; SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; SET escape_string_warning = off;

-- -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres --

COMMENT ON SCHEMA public IS 'Standard public schema';

-- -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres --

CREATE PROCEDURAL LANGUAGE plpgsql;

SET search_path = public, pg_catalog;

-- -- Name: getcustomvalues(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres --

CREATE FUNCTION getcustomvalues(integer, integer) RETURNS text

AS $_$

DECLARE p_ticketid ALIAS FOR $1; p_queueid ALIAS FOR $2; main_sql TEXT:=''; sub_sql TEXT:=''; rec_tmp RECORD; rec_sub_tmp RECORD; int_cus_field INTEGER; ret_val TEXT:='';

BEGIN

main_sql = 'SELECT c.name,c.id FROM customfields c,objectcustomfields o WHERE c.id = o.customfield AND c.disabled=0 AND o.objectid = ' || p_queueid;
  -- RAISE EXCEPTION 'last trap %',main_sql;
 
 FOR rec_tmp IN EXECUTE main_sql LOOP
 
         int_cus_field = rec_tmp.id;
         sub_sql = 'SELECT content FROM objectcustomfieldvalues WHERE objecttype=' || quote_literal('RT::Ticket') || ' AND objectid=' || p_ticketid || ' AND customfield = ' || int_cus_field || ' ORDER BY created DESC LIMIT 1 OFFSET 0';
         -- RAISE EXCEPTION 'last trap %',sub_sql;
         EXECUTE sub_sql INTO rec_sub_tmp ;
 
         IF rec_sub_tmp.content IS NULL OR rec_sub_tmp.content='' THEN
                 -- RAISE EXCEPTION 'last trap %',sub_sql;
                 ret_val = ret_val || rec_tmp.name || '#@ - ,';
         ELSE
                 ret_val = ret_val || rec_tmp.name || '#@' || rec_sub_tmp.content || ',';
         END IF;
 END LOOP;
         IF (char_length(ret_val)) > 0 THEN
                 ret_val = overlay(ret_val placing '' from char_length(ret_val) for 1);
         END IF;
 
 

RETURN ret_val; END;

$_$
  LANGUAGE plpgsql;


ALTER FUNCTION public.getcustomvalues(integer, integer) OWNER TO postgres;

-- -- Name: getrequestors(integer); Type: FUNCTION; Schema: public; Owner: postgres --

CREATE FUNCTION getrequestors(integer) RETURNS text

AS $_$

DECLARE p_ticketid ALIAS FOR $1; p_requestor text:=''; rec_tmp RECORD;

BEGIN FOR rec_tmp IN SELECT users.name as req_name from groups,groupmembers,users where groups.instance=p_ticketid and groups.type='Requestor' and groups.id=groupmembers.groupid and groupmembers.memberid=users.id order by groupmembers.id desc LOOP IF rec_tmp.req_name <> '-' THEN p_requestor = p_requestor || rec_tmp.req_name || ','; END IF;

END LOOP; IF (char_length(p_requestor)) > 0 THEN p_requestor = overlay(p_requestor placing '' from char_length(p_requestor) for 1); END IF; RETURN p_requestor; END; $_$

LANGUAGE plpgsql;


ALTER FUNCTION public.getrequestors(integer) OWNER TO postgres;

-- -- Name: plpgsql_call_handler(); Type: FUNCTION; Schema: public; Owner: postgres --

CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler

AS '$libdir/plpgsql', 'plpgsql_call_handler'
LANGUAGE c;


ALTER FUNCTION public.plpgsql_call_handler() OWNER TO postgres;

-- -- Name: statuswisereport(integer, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres --

CREATE FUNCTION statuswisereport(integer, timestamp without time zone, timestamp without time zone) RETURNS text

AS $_$

DECLARE p_clientid ALIAS FOR $1; p_datefrom ALIAS FOR $2; p_dateto ALIAS FOR $3; queue_qry TEXT; status_qry TEXT; ret_val TEXT:=''; res_str TEXT:=''; date_qry TEXT:=''; main_qry TEXT:=''; sub_qry TEXT:=''; subres_str TEXT:=''; l_cnt INTEGER:=0; rec_tmp RECORD; rec_status_tmp RECORD; BEGIN IF p_datefrom is not NULL AND p_dateto is not NULL THEN -- date_qry := ' AND t.lastupdated BETWEEN \'' || p_datefrom || '\' AND \'' || p_dateto || '\'' ; date_qry := ' AND t.lastupdated BETWEEN ' || quote_literal(p_datefrom) || ' AND ' || quote_literal (p_dateto) ; END IF; IF p_datefrom is not NULL AND p_dateto is NULL THEN date_qry := ' AND t.lastupdated >= ' || quote_literal(p_datefrom) ; END IF; IF p_datefrom is NULL AND p_dateto is not NULL THEN date_qry := ' AND t.lastupdated <= ' || quote_literal(p_dateto) ; END IF;

main_qry := 'SELECT q.name as queuename,count(t.id) as totticket,t.queue,round(avg(timeworked),0) as avgtimetaken from tickets t,queues q WHERE q.id = t.queue ' || date_qry || ' GROUP BY q.name,t.queue ORDER BY q.name';

FOR rec_tmp IN EXECUTE main_qry LOOP res_str:= rec_tmp.queuename || '#@' || rec_tmp.totticket || '#@' || rec_tmp.avgtimetaken ; subres_str:=''; sub_qry := 'SELECT count(id) as statuscnt,status FROM tickets t WHERE queue =' || rec_tmp.queue || date_qry || ' GROUP BY status ORDER BY status';

FOR rec_status_tmp IN EXECUTE sub_qry LOOP

subres_str = subres_str || '#@' || rec_status_tmp.status || '#@' || rec_status_tmp.statuscnt; END LOOP; ret_val = ret_val || res_str || subres_str || ',';

END LOOP;

RETURN ret_val; END;

$_$
   LANGUAGE plpgsql;


ALTER FUNCTION public.statuswisereport(integer, timestamp without time zone, timestamp without time zone) OWNER TO postgres;

-- -- Name: acl_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE acl_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.acl_id_seq OWNER TO root;

SET default_tablespace = '';

SET default_with_oids = false;

-- -- Name: acl; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE acl (

id integer DEFAULT nextval('acl_id_seq'::regclass) NOT NULL,
principaltype character varying(25) NOT NULL,
principalid integer NOT NULL,
rightname character varying(25) NOT NULL,
objecttype character varying(25) NOT NULL,
objectid integer DEFAULT 0 NOT NULL,
delegatedby integer DEFAULT 0 NOT NULL,
delegatedfrom integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.acl OWNER TO root;

-- -- Name: ams; Type: TABLE; Schema: public; Owner: postgres; Tablespace: --

CREATE TABLE ams (

empid integer NOT NULL,
empname text NOT NULL,
team text,
date date NOT NULL,
att text NOT NULL,
schedulein time without time zone,
actualin time without time zone,
diff time without time zone,
scheduleout time without time zone,
actualout time without time zone,
logged interval,
remarks text

);

ALTER TABLE public.ams OWNER TO postgres;

-- -- Name: at_assets; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE at_assets (

id integer NOT NULL,
"type" integer DEFAULT 0 NOT NULL,
name character varying(200) NOT NULL,
description character varying(255),
status character varying(20),
uri character varying(255),
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone

);

ALTER TABLE public.at_assets OWNER TO root;

-- -- Name: at_assets_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE at_assets_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.at_assets_id_seq OWNER TO root;

-- -- Name: at_assets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: root --

ALTER SEQUENCE at_assets_id_seq OWNED BY at_assets.id;

-- -- Name: at_ips; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE at_ips (

id integer NOT NULL,
ip character(15) NOT NULL,
mac character(12),
interface character varying(25) DEFAULT 0,
asset integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.at_ips OWNER TO root;

-- -- Name: at_ips_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE at_ips_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.at_ips_id_seq OWNER TO root;

-- -- Name: at_ips_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: root --

ALTER SEQUENCE at_ips_id_seq OWNED BY at_ips.id;

-- -- Name: at_ports; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE at_ports (

id integer NOT NULL,
transport character(15) NOT NULL,
port character(12),
ip integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.at_ports OWNER TO root;

-- -- Name: at_ports_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE at_ports_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.at_ports_id_seq OWNER TO root;

-- -- Name: at_ports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: root --

ALTER SEQUENCE at_ports_id_seq OWNED BY at_ports.id;

-- -- Name: at_types; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE at_types (

id integer NOT NULL,
name character varying(200) NOT NULL,
description character varying(255),
defaultadmin integer DEFAULT 0,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.at_types OWNER TO root;

-- -- Name: at_types_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE at_types_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.at_types_id_seq OWNER TO root;

-- -- Name: at_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: root --

ALTER SEQUENCE at_types_id_seq OWNED BY at_types.id;

-- -- Name: attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE attachments_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.attachments_id_seq OWNER TO root;

-- -- Name: attachments; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE attachments (

id integer DEFAULT nextval('attachments_id_seq'::regclass) NOT NULL,
transactionid integer NOT NULL,
parent integer DEFAULT 0 NOT NULL,
messageid character varying(160),
subject character varying(255),
filename character varying(255),
contenttype character varying(80),
contentencoding character varying(80),
content text,
headers text,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone

);

ALTER TABLE public.attachments OWNER TO root;

-- -- Name: attributes_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE attributes_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.attributes_id_seq OWNER TO root;

-- -- Name: attributes; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE attributes (

id integer DEFAULT nextval('attributes_id_seq'::regclass) NOT NULL,
name character varying(255) NOT NULL,
description character varying(255),
content text,
contenttype character varying(16),
objecttype character varying(64),
objectid integer,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.attributes OWNER TO root;

-- -- Name: cachedgroupmembers_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE cachedgroupmembers_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.cachedgroupmembers_id_seq OWNER TO root;

-- -- Name: cachedgroupmembers; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE cachedgroupmembers (

id integer DEFAULT nextval('cachedgroupmembers_id_seq'::regclass) NOT NULL,
groupid integer,
memberid integer,
via integer,
immediateparentid integer,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.cachedgroupmembers OWNER TO root;

-- -- Name: customfields_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE customfields_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.customfields_id_seq OWNER TO root;

-- -- Name: customfields; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE customfields (

id integer DEFAULT nextval('customfields_id_seq'::regclass) NOT NULL,
name character varying(200),
"type" character varying(200),
maxvalues integer DEFAULT 0 NOT NULL,
repeated integer DEFAULT 0 NOT NULL,
pattern character varying(65536),
lookuptype character varying(255) NOT NULL,
description character varying(255),
sortorder integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.customfields OWNER TO root;

-- -- Name: customfieldvalues_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE customfieldvalues_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.customfieldvalues_id_seq OWNER TO root;

-- -- Name: customfieldvalues; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE customfieldvalues (

id integer DEFAULT nextval('customfieldvalues_id_seq'::regclass) NOT NULL,
customfield integer NOT NULL,
name character varying(200),
description character varying(255),
sortorder integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.customfieldvalues OWNER TO root;

-- -- Name: fm_articles; Type: TABLE; Schema: public; Owner: rt_user; Tablespace: --

CREATE TABLE fm_articles (

id integer NOT NULL,
 name character varying(255) DEFAULT ''::character varying NOT NULL,
 summary character varying(255) DEFAULT ''::character varying NOT NULL,
 sortorder integer DEFAULT 0 NOT NULL,
 "class" integer DEFAULT 0 NOT NULL,
 parent integer DEFAULT 0 NOT NULL,
 uri character varying(255),
 creator integer DEFAULT 0 NOT NULL,
 created timestamp without time zone,
 lastupdatedby integer DEFAULT 0 NOT NULL,
 lastupdated timestamp without time zone
 

);

ALTER TABLE public.fm_articles OWNER TO rt_user;

-- -- Name: fm_articles_id_seq; Type: SEQUENCE; Schema: public; Owner: rt_user --

CREATE SEQUENCE fm_articles_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.fm_articles_id_seq OWNER TO rt_user;

-- -- Name: fm_articles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rt_user --

ALTER SEQUENCE fm_articles_id_seq OWNED BY fm_articles.id;

-- -- Name: fm_classes; Type: TABLE; Schema: public; Owner: rt_user; Tablespace: --

CREATE TABLE fm_classes (

id integer NOT NULL,
 name character varying(255) DEFAULT ''::character varying NOT NULL,
 description character varying(255) DEFAULT ''::character varying NOT NULL,
 sortorder integer DEFAULT 0 NOT NULL,
 disabled smallint DEFAULT 0 NOT NULL,
 creator integer DEFAULT 0 NOT NULL,
 created timestamp without time zone,
 lastupdatedby integer DEFAULT 0 NOT NULL,
 lastupdated timestamp without time zone,
 hotlist smallint DEFAULT 0 NOT NULL
 

);

ALTER TABLE public.fm_classes OWNER TO rt_user;

-- -- Name: fm_classes_id_seq; Type: SEQUENCE; Schema: public; Owner: rt_user --

CREATE SEQUENCE fm_classes_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.fm_classes_id_seq OWNER TO rt_user;

-- -- Name: fm_classes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rt_user --

ALTER SEQUENCE fm_classes_id_seq OWNED BY fm_classes.id;

-- -- Name: fm_objecttopics; Type: TABLE; Schema: public; Owner: rt_user; Tablespace: --

CREATE TABLE fm_objecttopics (

id integer NOT NULL,
 topic integer NOT NULL,
 objecttype character varying(64) DEFAULT ''::character varying NOT NULL,
 objectid integer NOT NULL
 

);

ALTER TABLE public.fm_objecttopics OWNER TO rt_user;

-- -- Name: fm_objecttopics_id_seq; Type: SEQUENCE; Schema: public; Owner: rt_user --

CREATE SEQUENCE fm_objecttopics_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.fm_objecttopics_id_seq OWNER TO rt_user;

-- -- Name: fm_objecttopics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rt_user --

ALTER SEQUENCE fm_objecttopics_id_seq OWNED BY fm_objecttopics.id;

-- -- Name: fm_topics; Type: TABLE; Schema: public; Owner: rt_user; Tablespace: --

CREATE TABLE fm_topics (

id integer NOT NULL,
 parent integer DEFAULT 0 NOT NULL,
 name character varying(255) DEFAULT ''::character varying NOT NULL,
 description character varying(255) DEFAULT ''::character varying NOT NULL,
 objecttype character varying(64) DEFAULT ''::character varying NOT NULL,
 objectid integer NOT NULL
 

);

ALTER TABLE public.fm_topics OWNER TO rt_user;

-- -- Name: fm_topics_id_seq; Type: SEQUENCE; Schema: public; Owner: rt_user --

CREATE SEQUENCE fm_topics_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.fm_topics_id_seq OWNER TO rt_user;

-- -- Name: fm_topics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rt_user --

ALTER SEQUENCE fm_topics_id_seq OWNED BY fm_topics.id;

-- -- Name: groupmembers_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE groupmembers_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.groupmembers_id_seq OWNER TO root;

-- -- Name: groupmembers; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE groupmembers (

id integer DEFAULT nextval('groupmembers_id_seq'::regclass) NOT NULL,
groupid integer DEFAULT 0 NOT NULL,
memberid integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.groupmembers OWNER TO root;

-- -- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE groups_id_seq

START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.groups_id_seq OWNER TO root;

-- -- Name: groups; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE groups (

id integer DEFAULT nextval('groups_id_seq'::regclass) NOT NULL,
name character varying(200),
description character varying(255),
"domain" character varying(64),
"type" character varying(64),
instance integer

);

ALTER TABLE public.groups OWNER TO root;

-- -- Name: links_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE links_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.links_id_seq OWNER TO root;

-- -- Name: links; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE links (

id integer DEFAULT nextval('links_id_seq'::regclass) NOT NULL,
base character varying(240),
target character varying(240),
"type" character varying(20) NOT NULL,
localtarget integer DEFAULT 0 NOT NULL,
localbase integer DEFAULT 0 NOT NULL,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone

);

ALTER TABLE public.links OWNER TO root;

-- -- Name: objectcustomfields_id_s; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE objectcustomfields_id_s

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.objectcustomfields_id_s OWNER TO root;

-- -- Name: objectcustomfields; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE objectcustomfields (

id integer DEFAULT nextval('objectcustomfields_id_s'::regclass) NOT NULL,
customfield integer NOT NULL,
objectid integer NOT NULL,
sortorder integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.objectcustomfields OWNER TO root;

-- -- Name: objectcustomfieldvalues_id_s; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE objectcustomfieldvalues_id_s

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.objectcustomfieldvalues_id_s OWNER TO root;

-- -- Name: objectcustomfieldvalues; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE objectcustomfieldvalues (

id integer DEFAULT nextval('objectcustomfieldvalues_id_s'::regclass) NOT NULL,
customfield integer NOT NULL,
objecttype character varying(255),
objectid integer NOT NULL,
sortorder integer DEFAULT 0 NOT NULL,
content character varying(255),
largecontent text,
contenttype character varying(80),
contentencoding character varying(80),
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.objectcustomfieldvalues OWNER TO root;

-- -- Name: principals_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE principals_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.principals_id_seq OWNER TO root;

-- -- Name: principals; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE principals (

id integer DEFAULT nextval('principals_id_seq'::regclass) NOT NULL,
principaltype character varying(16) NOT NULL,
objectid integer,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.principals OWNER TO root;

-- -- Name: queues_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE queues_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.queues_id_seq OWNER TO root;

-- -- Name: queues; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE queues (

id integer DEFAULT nextval('queues_id_seq'::regclass) NOT NULL,
name character varying(200) NOT NULL,
description character varying(255),
correspondaddress character varying(120),
commentaddress character varying(120),
initialpriority integer DEFAULT 0 NOT NULL,
finalpriority integer DEFAULT 0 NOT NULL,
defaultduein integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.queues OWNER TO root;

-- -- Name: scripactions_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE scripactions_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.scripactions_id_seq OWNER TO root;

-- -- Name: scripactions; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE scripactions (

id integer DEFAULT nextval('scripactions_id_seq'::regclass) NOT NULL,
name character varying(200),
description character varying(255),
execmodule character varying(60),
argument character varying(255),
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.scripactions OWNER TO root;

-- -- Name: scripconditions_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE scripconditions_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.scripconditions_id_seq OWNER TO root;

-- -- Name: scripconditions; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE scripconditions (

id integer DEFAULT nextval('scripconditions_id_seq'::regclass) NOT NULL,
name character varying(200),
description character varying(255),
execmodule character varying(60),
argument character varying(255),
applicabletranstypes character varying(60),
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.scripconditions OWNER TO root;

-- -- Name: scrips_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE scrips_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.scrips_id_seq OWNER TO root;

-- -- Name: scrips; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE scrips (

id integer DEFAULT nextval('scrips_id_seq'::regclass) NOT NULL,
description character varying(255),
scripcondition integer DEFAULT 0 NOT NULL,
scripaction integer DEFAULT 0 NOT NULL,
conditionrules text,
actionrules text,
customisapplicablecode text,
custompreparecode text,
customcommitcode text,
stage character varying(32),
queue integer DEFAULT 0 NOT NULL,
"template" integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.scrips OWNER TO root;

-- -- Name: sessions; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE sessions (

id character(32) NOT NULL,
a_session bytea,
lastupdated timestamp without time zone DEFAULT now() NOT NULL

);

ALTER TABLE public.sessions OWNER TO root;

-- -- Name: templates_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE templates_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.templates_id_seq OWNER TO root;

-- -- Name: templates; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE templates (

id integer DEFAULT nextval('templates_id_seq'::regclass) NOT NULL,
queue integer DEFAULT 0 NOT NULL,
name character varying(200) NOT NULL,
description character varying(255),
"type" character varying(16),
"language" character varying(16),
translationof integer DEFAULT 0 NOT NULL,
content text,
lastupdated timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone

);

ALTER TABLE public.templates OWNER TO root;

-- -- Name: tickets_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE tickets_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.tickets_id_seq OWNER TO root;

-- -- Name: tickets; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE tickets (

id integer DEFAULT nextval('tickets_id_seq'::regclass) NOT NULL,
effectiveid integer DEFAULT 0 NOT NULL,
queue integer DEFAULT 0 NOT NULL,
"type" character varying(16),
issuestatement integer DEFAULT 0 NOT NULL,
resolution integer DEFAULT 0 NOT NULL,
"owner" integer DEFAULT 0 NOT NULL,
subject character varying(200) DEFAULT '[no subject]'::character varying,
initialpriority integer DEFAULT 0 NOT NULL,
finalpriority integer DEFAULT 0 NOT NULL,
priority integer DEFAULT 0 NOT NULL,
timeestimated integer DEFAULT 0 NOT NULL,
timeworked integer DEFAULT 0 NOT NULL,
status character varying(10),
timeleft integer DEFAULT 0 NOT NULL,
told timestamp without time zone,
starts timestamp without time zone,
started timestamp without time zone,
due timestamp without time zone,
resolved timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
disabled integer DEFAULT 0 NOT NULL

);

ALTER TABLE public.tickets OWNER TO root;

-- -- Name: transactions_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE transactions_id_seq

INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.transactions_id_seq OWNER TO root;

-- -- Name: transactions; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE transactions (

id integer DEFAULT nextval('transactions_id_seq'::regclass) NOT NULL,
objecttype character varying(255) NOT NULL,
objectid integer DEFAULT 0 NOT NULL,
timetaken integer DEFAULT 0 NOT NULL,
"type" character varying(20),
field character varying(40),
oldvalue character varying(255),
newvalue character varying(255),
referencetype character varying(255),
oldreference integer,
newreference integer,
data character varying(255),
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone

);

ALTER TABLE public.transactions OWNER TO root;

-- -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: root --

CREATE SEQUENCE users_id_seq

START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.users_id_seq OWNER TO root;

-- -- Name: users; Type: TABLE; Schema: public; Owner: root; Tablespace: --

CREATE TABLE users (

id integer DEFAULT nextval('users_id_seq'::regclass) NOT NULL,
name character varying(200) NOT NULL,
"password" character varying(40),
comments text,
signature text,
emailaddress character varying(120),
freeformcontactinfo text,
organization character varying(200),
realname character varying(120),
nickname character varying(16),
lang character varying(16),
emailencoding character varying(16),
webencoding character varying(16),
externalcontactinfoid character varying(100),
contactinfosystem character varying(30),
externalauthid character varying(100),
authsystem character varying(30),
gecos character varying(16),
homephone character varying(30),
workphone character varying(30),
mobilephone character varying(30),
pagerphone character varying(30),
address1 character varying(200),
address2 character varying(200),
city character varying(100),
state character varying(100),
zip character varying(16),
country character varying(50),
timezone character varying(50),
pgpkey text,
creator integer DEFAULT 0 NOT NULL,
created timestamp without time zone,
lastupdatedby integer DEFAULT 0 NOT NULL,
lastupdated timestamp without time zone

);

ALTER TABLE public.users OWNER TO root;

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: root --

ALTER TABLE at_assets ALTER COLUMN id SET DEFAULT nextval('at_assets_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: root --

ALTER TABLE at_ips ALTER COLUMN id SET DEFAULT nextval('at_ips_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: root --

ALTER TABLE at_ports ALTER COLUMN id SET DEFAULT nextval('at_ports_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: root --

ALTER TABLE at_types ALTER COLUMN id SET DEFAULT nextval('at_types_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: rt_user --

ALTER TABLE fm_articles ALTER COLUMN id SET DEFAULT nextval('fm_articles_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: rt_user --

ALTER TABLE fm_classes ALTER COLUMN id SET DEFAULT nextval('fm_classes_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: rt_user --

ALTER TABLE fm_objecttopics ALTER COLUMN id SET DEFAULT nextval('fm_objecttopics_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: rt_user --

ALTER TABLE fm_topics ALTER COLUMN id SET DEFAULT nextval('fm_topics_id_seq'::regclass);

-- -- Name: acl_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY acl

ADD CONSTRAINT acl_pkey PRIMARY KEY (id);


-- -- Name: at_assets_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY at_assets

ADD CONSTRAINT at_assets_pkey PRIMARY KEY (id);


-- -- Name: at_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY at_ips

ADD CONSTRAINT at_ips_pkey PRIMARY KEY (id);


-- -- Name: at_ports_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY at_ports

ADD CONSTRAINT at_ports_pkey PRIMARY KEY (id);


-- -- Name: at_types_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY at_types

ADD CONSTRAINT at_types_pkey PRIMARY KEY (id);


-- -- Name: attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY attachments

ADD CONSTRAINT attachments_pkey PRIMARY KEY (id);


-- -- Name: attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY attributes

ADD CONSTRAINT attributes_pkey PRIMARY KEY (id);


-- -- Name: cachedgroupmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY cachedgroupmembers

ADD CONSTRAINT cachedgroupmembers_pkey PRIMARY KEY (id);


-- -- Name: customfields_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY customfields

ADD CONSTRAINT customfields_pkey PRIMARY KEY (id);


-- -- Name: customfieldvalues_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY customfieldvalues

ADD CONSTRAINT customfieldvalues_pkey PRIMARY KEY (id);


-- -- Name: fm_articles_pkey; Type: CONSTRAINT; Schema: public; Owner: rt_user; Tablespace: --

ALTER TABLE ONLY fm_articles

ADD CONSTRAINT fm_articles_pkey PRIMARY KEY (id);


-- -- Name: fm_classes_pkey; Type: CONSTRAINT; Schema: public; Owner: rt_user; Tablespace: --

ALTER TABLE ONLY fm_classes

ADD CONSTRAINT fm_classes_pkey PRIMARY KEY (id);


-- -- Name: fm_objecttopics_pkey; Type: CONSTRAINT; Schema: public; Owner: rt_user; Tablespace: --

ALTER TABLE ONLY fm_objecttopics

ADD CONSTRAINT fm_objecttopics_pkey PRIMARY KEY (id);


-- -- Name: fm_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: rt_user; Tablespace: --

ALTER TABLE ONLY fm_topics

ADD CONSTRAINT fm_topics_pkey PRIMARY KEY (id);


-- -- Name: groupmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY groupmembers

ADD CONSTRAINT groupmembers_pkey PRIMARY KEY (id);


-- -- Name: groups_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY groups

ADD CONSTRAINT groups_pkey PRIMARY KEY (id);


-- -- Name: links_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY links

ADD CONSTRAINT links_pkey PRIMARY KEY (id);


-- -- Name: objectcustomfields_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY objectcustomfields

ADD CONSTRAINT objectcustomfields_pkey PRIMARY KEY (id);


-- -- Name: objectcustomfieldvalues_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY objectcustomfieldvalues

ADD CONSTRAINT objectcustomfieldvalues_pkey PRIMARY KEY (id);


-- -- Name: principals_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY principals

ADD CONSTRAINT principals_pkey PRIMARY KEY (id);


-- -- Name: queues_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY queues

ADD CONSTRAINT queues_pkey PRIMARY KEY (id);


-- -- Name: scripactions_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY scripactions

ADD CONSTRAINT scripactions_pkey PRIMARY KEY (id);


-- -- Name: scripconditions_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY scripconditions

ADD CONSTRAINT scripconditions_pkey PRIMARY KEY (id);


-- -- Name: scrips_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY scrips

ADD CONSTRAINT scrips_pkey PRIMARY KEY (id);


-- -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY sessions

ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);


-- -- Name: templates_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY templates

ADD CONSTRAINT templates_pkey PRIMARY KEY (id);


-- -- Name: tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY tickets

ADD CONSTRAINT tickets_pkey PRIMARY KEY (id);


-- -- Name: transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY transactions

ADD CONSTRAINT transactions_pkey PRIMARY KEY (id);


-- -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: root; Tablespace: --

ALTER TABLE ONLY users

ADD CONSTRAINT users_pkey PRIMARY KEY (id);


-- -- Name: acl1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX acl1 ON acl USING btree (rightname, objecttype, objectid, principaltype, principalid);

-- -- Name: at_assets1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_assets1 ON at_assets USING btree ("type", status);

-- -- Name: at_assets2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_assets2 ON at_assets USING btree (name, "type", status);

-- -- Name: at_ips1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE UNIQUE INDEX at_ips1 ON at_ips USING btree (ip);

-- -- Name: at_ips2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_ips2 ON at_ips USING btree (asset);

-- -- Name: at_ports1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_ports1 ON at_ports USING btree (port);

-- -- Name: at_ports2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_ports2 ON at_ports USING btree (transport, port);

-- -- Name: at_ports3; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_ports3 ON at_ports USING btree (ip);

-- -- Name: at_types1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE UNIQUE INDEX at_types1 ON at_types USING btree (name);

-- -- Name: at_types2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX at_types2 ON at_types USING btree (disabled);

-- -- Name: attachments1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX attachments1 ON attachments USING btree (parent);

-- -- Name: attachments2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX attachments2 ON attachments USING btree (transactionid);

-- -- Name: attachments3; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX attachments3 ON attachments USING btree (parent, transactionid);

-- -- Name: attributes1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX attributes1 ON attributes USING btree (name);

-- -- Name: attributes2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX attributes2 ON attributes USING btree (objecttype, objectid);

-- -- Name: cachedgroupmembers2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX cachedgroupmembers2 ON cachedgroupmembers USING btree (memberid);

-- -- Name: cachedgroupmembers3; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX cachedgroupmembers3 ON cachedgroupmembers USING btree (groupid);

-- -- Name: customfieldvalues1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX customfieldvalues1 ON customfieldvalues USING btree (customfield);

-- -- Name: disgroumem; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX disgroumem ON cachedgroupmembers USING btree (groupid, memberid, disabled);

-- -- Name: groups1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE UNIQUE INDEX groups1 ON groups USING btree ("domain", instance, "type", id, name);

-- -- Name: groups2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX groups2 ON groups USING btree ("type", instance, "domain");

-- -- Name: links1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE UNIQUE INDEX links1 ON links USING btree (base, target, "type");

-- -- Name: links4; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX links4 ON links USING btree ("type", localbase);

-- -- Name: objectcustomfieldvalues1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX objectcustomfieldvalues1 ON objectcustomfieldvalues USING btree (customfield, objecttype, objectid, content);

-- -- Name: objectcustomfieldvalues2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX objectcustomfieldvalues2 ON objectcustomfieldvalues USING btree (customfield, objecttype, objectid);

-- -- Name: principals2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX principals2 ON principals USING btree (objectid);

-- -- Name: queues1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE UNIQUE INDEX queues1 ON queues USING btree (name);

-- -- Name: tickets1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX tickets1 ON tickets USING btree (queue, status);

-- -- Name: tickets2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX tickets2 ON tickets USING btree ("owner");

-- -- Name: tickets3; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX tickets3 ON tickets USING btree (effectiveid);

-- -- Name: tickets4; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX tickets4 ON tickets USING btree (id, status);

-- -- Name: tickets5; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX tickets5 ON tickets USING btree (id, effectiveid);

-- -- Name: transactions1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX transactions1 ON transactions USING btree (objecttype, objectid);

-- -- Name: users1; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE UNIQUE INDEX users1 ON users USING btree (name);

-- -- Name: users2; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX users2 ON users USING btree (name);

-- -- Name: users3; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX users3 ON users USING btree (id, emailaddress);

-- -- Name: users4; Type: INDEX; Schema: public; Owner: root; Tablespace: --

CREATE INDEX users4 ON users USING btree (emailaddress);

-- -- Name: public; Type: ACL; Schema: -; Owner: postgres --

REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC;

-- -- Name: acl_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE acl_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE acl_id_seq FROM root; GRANT ALL ON SEQUENCE acl_id_seq TO root; GRANT ALL ON SEQUENCE acl_id_seq TO rt_user; GRANT SELECT ON SEQUENCE acl_id_seq TO PUBLIC;

-- -- Name: acl; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE acl FROM PUBLIC; REVOKE ALL ON TABLE acl FROM root; GRANT ALL ON TABLE acl TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE acl TO rt_user; GRANT SELECT ON TABLE acl TO PUBLIC;

-- -- Name: at_assets; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE at_assets FROM PUBLIC; REVOKE ALL ON TABLE at_assets FROM root; GRANT ALL ON TABLE at_assets TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE at_assets TO rt_user; GRANT SELECT ON TABLE at_assets TO PUBLIC;

-- -- Name: at_assets_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE at_assets_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE at_assets_id_seq FROM root; GRANT ALL ON SEQUENCE at_assets_id_seq TO root; GRANT SELECT,UPDATE ON SEQUENCE at_assets_id_seq TO rt_user; GRANT SELECT ON SEQUENCE at_assets_id_seq TO PUBLIC;

-- -- Name: at_ips; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE at_ips FROM PUBLIC; REVOKE ALL ON TABLE at_ips FROM root; GRANT ALL ON TABLE at_ips TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE at_ips TO rt_user; GRANT SELECT ON TABLE at_ips TO PUBLIC;

-- -- Name: at_ips_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE at_ips_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE at_ips_id_seq FROM root; GRANT ALL ON SEQUENCE at_ips_id_seq TO root; GRANT SELECT,UPDATE ON SEQUENCE at_ips_id_seq TO rt_user; GRANT SELECT ON SEQUENCE at_ips_id_seq TO PUBLIC;

-- -- Name: at_ports; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE at_ports FROM PUBLIC; REVOKE ALL ON TABLE at_ports FROM root; GRANT ALL ON TABLE at_ports TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE at_ports TO rt_user; GRANT SELECT ON TABLE at_ports TO PUBLIC;

-- -- Name: at_ports_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE at_ports_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE at_ports_id_seq FROM root; GRANT ALL ON SEQUENCE at_ports_id_seq TO root; GRANT SELECT,UPDATE ON SEQUENCE at_ports_id_seq TO rt_user; GRANT SELECT ON SEQUENCE at_ports_id_seq TO PUBLIC;

-- -- Name: at_types; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE at_types FROM PUBLIC; REVOKE ALL ON TABLE at_types FROM root; GRANT ALL ON TABLE at_types TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE at_types TO rt_user; GRANT SELECT ON TABLE at_types TO PUBLIC;

-- -- Name: at_types_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE at_types_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE at_types_id_seq FROM root; GRANT ALL ON SEQUENCE at_types_id_seq TO root; GRANT SELECT,UPDATE ON SEQUENCE at_types_id_seq TO rt_user; GRANT SELECT ON SEQUENCE at_types_id_seq TO PUBLIC;

-- -- Name: attachments_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE attachments_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE attachments_id_seq FROM root; GRANT ALL ON SEQUENCE attachments_id_seq TO root; GRANT ALL ON SEQUENCE attachments_id_seq TO rt_user; GRANT SELECT ON SEQUENCE attachments_id_seq TO PUBLIC;

-- -- Name: attachments; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE attachments FROM PUBLIC; REVOKE ALL ON TABLE attachments FROM root; GRANT ALL ON TABLE attachments TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE attachments TO rt_user; GRANT SELECT ON TABLE attachments TO PUBLIC;

-- -- Name: attributes_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE attributes_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE attributes_id_seq FROM root; GRANT ALL ON SEQUENCE attributes_id_seq TO root; GRANT ALL ON SEQUENCE attributes_id_seq TO rt_user; GRANT SELECT ON SEQUENCE attributes_id_seq TO PUBLIC;

-- -- Name: attributes; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE attributes FROM PUBLIC; REVOKE ALL ON TABLE attributes FROM root; GRANT ALL ON TABLE attributes TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE attributes TO rt_user; GRANT SELECT ON TABLE attributes TO PUBLIC;

-- -- Name: cachedgroupmembers_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE cachedgroupmembers_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE cachedgroupmembers_id_seq FROM root; GRANT ALL ON SEQUENCE cachedgroupmembers_id_seq TO root; GRANT ALL ON SEQUENCE cachedgroupmembers_id_seq TO rt_user; GRANT SELECT ON SEQUENCE cachedgroupmembers_id_seq TO PUBLIC;

-- -- Name: cachedgroupmembers; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE cachedgroupmembers FROM PUBLIC; REVOKE ALL ON TABLE cachedgroupmembers FROM root; GRANT ALL ON TABLE cachedgroupmembers TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE cachedgroupmembers TO rt_user; GRANT SELECT ON TABLE cachedgroupmembers TO PUBLIC;

-- -- Name: customfields_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE customfields_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE customfields_id_seq FROM root; GRANT ALL ON SEQUENCE customfields_id_seq TO root; GRANT ALL ON SEQUENCE customfields_id_seq TO rt_user; GRANT SELECT ON SEQUENCE customfields_id_seq TO PUBLIC;

-- -- Name: customfields; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE customfields FROM PUBLIC; REVOKE ALL ON TABLE customfields FROM root; GRANT ALL ON TABLE customfields TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE customfields TO rt_user; GRANT SELECT ON TABLE customfields TO PUBLIC;

-- -- Name: customfieldvalues_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE customfieldvalues_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE customfieldvalues_id_seq FROM root; GRANT ALL ON SEQUENCE customfieldvalues_id_seq TO root; GRANT ALL ON SEQUENCE customfieldvalues_id_seq TO rt_user; GRANT SELECT ON SEQUENCE customfieldvalues_id_seq TO PUBLIC;

-- -- Name: customfieldvalues; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE customfieldvalues FROM PUBLIC; REVOKE ALL ON TABLE customfieldvalues FROM root; GRANT ALL ON TABLE customfieldvalues TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE customfieldvalues TO rt_user; GRANT SELECT ON TABLE customfieldvalues TO PUBLIC;

-- -- Name: fm_articles; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON TABLE fm_articles FROM PUBLIC; REVOKE ALL ON TABLE fm_articles FROM rt_user; GRANT ALL ON TABLE fm_articles TO rt_user; GRANT SELECT ON TABLE fm_articles TO PUBLIC;

-- -- Name: fm_articles_id_seq; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON SEQUENCE fm_articles_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE fm_articles_id_seq FROM rt_user; GRANT ALL ON SEQUENCE fm_articles_id_seq TO rt_user; GRANT SELECT ON SEQUENCE fm_articles_id_seq TO PUBLIC;

-- -- Name: fm_classes; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON TABLE fm_classes FROM PUBLIC; REVOKE ALL ON TABLE fm_classes FROM rt_user; GRANT ALL ON TABLE fm_classes TO rt_user; GRANT SELECT ON TABLE fm_classes TO PUBLIC;

-- -- Name: fm_classes_id_seq; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON SEQUENCE fm_classes_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE fm_classes_id_seq FROM rt_user; GRANT ALL ON SEQUENCE fm_classes_id_seq TO rt_user; GRANT SELECT ON SEQUENCE fm_classes_id_seq TO PUBLIC;

-- -- Name: fm_objecttopics; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON TABLE fm_objecttopics FROM PUBLIC; REVOKE ALL ON TABLE fm_objecttopics FROM rt_user; GRANT ALL ON TABLE fm_objecttopics TO rt_user; GRANT SELECT ON TABLE fm_objecttopics TO PUBLIC;

-- -- Name: fm_objecttopics_id_seq; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON SEQUENCE fm_objecttopics_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE fm_objecttopics_id_seq FROM rt_user; GRANT ALL ON SEQUENCE fm_objecttopics_id_seq TO rt_user; GRANT SELECT ON SEQUENCE fm_objecttopics_id_seq TO PUBLIC;

-- -- Name: fm_topics; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON TABLE fm_topics FROM PUBLIC; REVOKE ALL ON TABLE fm_topics FROM rt_user; GRANT ALL ON TABLE fm_topics TO rt_user; GRANT SELECT ON TABLE fm_topics TO PUBLIC;

-- -- Name: fm_topics_id_seq; Type: ACL; Schema: public; Owner: rt_user --

REVOKE ALL ON SEQUENCE fm_topics_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE fm_topics_id_seq FROM rt_user; GRANT ALL ON SEQUENCE fm_topics_id_seq TO rt_user; GRANT SELECT ON SEQUENCE fm_topics_id_seq TO PUBLIC;

-- -- Name: groupmembers_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE groupmembers_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE groupmembers_id_seq FROM root; GRANT ALL ON SEQUENCE groupmembers_id_seq TO root; GRANT ALL ON SEQUENCE groupmembers_id_seq TO rt_user; GRANT SELECT ON SEQUENCE groupmembers_id_seq TO PUBLIC;

-- -- Name: groupmembers; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE groupmembers FROM PUBLIC; REVOKE ALL ON TABLE groupmembers FROM root; GRANT ALL ON TABLE groupmembers TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE groupmembers TO rt_user; GRANT SELECT ON TABLE groupmembers TO PUBLIC;

-- -- Name: groups_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE groups_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE groups_id_seq FROM root; GRANT ALL ON SEQUENCE groups_id_seq TO root; GRANT ALL ON SEQUENCE groups_id_seq TO rt_user; GRANT SELECT ON SEQUENCE groups_id_seq TO PUBLIC;

-- -- Name: groups; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE groups FROM PUBLIC; REVOKE ALL ON TABLE groups FROM root; GRANT ALL ON TABLE groups TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE groups TO rt_user; GRANT SELECT ON TABLE groups TO PUBLIC;

-- -- Name: links_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE links_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE links_id_seq FROM root; GRANT ALL ON SEQUENCE links_id_seq TO root; GRANT ALL ON SEQUENCE links_id_seq TO rt_user; GRANT SELECT ON SEQUENCE links_id_seq TO PUBLIC;

-- -- Name: links; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE links FROM PUBLIC; REVOKE ALL ON TABLE links FROM root; GRANT ALL ON TABLE links TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE links TO rt_user; GRANT SELECT ON TABLE links TO PUBLIC;

-- -- Name: objectcustomfields_id_s; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE objectcustomfields_id_s FROM PUBLIC; REVOKE ALL ON SEQUENCE objectcustomfields_id_s FROM root; GRANT ALL ON SEQUENCE objectcustomfields_id_s TO root; GRANT ALL ON SEQUENCE objectcustomfields_id_s TO rt_user; GRANT SELECT ON SEQUENCE objectcustomfields_id_s TO PUBLIC;

-- -- Name: objectcustomfields; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE objectcustomfields FROM PUBLIC; REVOKE ALL ON TABLE objectcustomfields FROM root; GRANT ALL ON TABLE objectcustomfields TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE objectcustomfields TO rt_user; GRANT SELECT ON TABLE objectcustomfields TO PUBLIC;

-- -- Name: objectcustomfieldvalues_id_s; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE objectcustomfieldvalues_id_s FROM PUBLIC; REVOKE ALL ON SEQUENCE objectcustomfieldvalues_id_s FROM root; GRANT ALL ON SEQUENCE objectcustomfieldvalues_id_s TO root; GRANT ALL ON SEQUENCE objectcustomfieldvalues_id_s TO rt_user; GRANT SELECT ON SEQUENCE objectcustomfieldvalues_id_s TO PUBLIC;

-- -- Name: objectcustomfieldvalues; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE objectcustomfieldvalues FROM PUBLIC; REVOKE ALL ON TABLE objectcustomfieldvalues FROM root; GRANT ALL ON TABLE objectcustomfieldvalues TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE objectcustomfieldvalues TO rt_user; GRANT SELECT ON TABLE objectcustomfieldvalues TO PUBLIC;

-- -- Name: principals_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE principals_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE principals_id_seq FROM root; GRANT ALL ON SEQUENCE principals_id_seq TO root; GRANT ALL ON SEQUENCE principals_id_seq TO rt_user; GRANT SELECT ON SEQUENCE principals_id_seq TO PUBLIC;

-- -- Name: principals; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE principals FROM PUBLIC; REVOKE ALL ON TABLE principals FROM root; GRANT ALL ON TABLE principals TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE principals TO rt_user; GRANT SELECT ON TABLE principals TO PUBLIC;

-- -- Name: queues_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE queues_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE queues_id_seq FROM root; GRANT ALL ON SEQUENCE queues_id_seq TO root; GRANT ALL ON SEQUENCE queues_id_seq TO rt_user; GRANT SELECT ON SEQUENCE queues_id_seq TO PUBLIC;

-- -- Name: queues; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE queues FROM PUBLIC; REVOKE ALL ON TABLE queues FROM root; GRANT ALL ON TABLE queues TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE queues TO rt_user; GRANT SELECT ON TABLE queues TO PUBLIC;

-- -- Name: scripactions_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE scripactions_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE scripactions_id_seq FROM root; GRANT ALL ON SEQUENCE scripactions_id_seq TO root; GRANT ALL ON SEQUENCE scripactions_id_seq TO rt_user; GRANT SELECT ON SEQUENCE scripactions_id_seq TO PUBLIC;

-- -- Name: scripactions; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE scripactions FROM PUBLIC; REVOKE ALL ON TABLE scripactions FROM root; GRANT ALL ON TABLE scripactions TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE scripactions TO rt_user; GRANT SELECT ON TABLE scripactions TO PUBLIC;

-- -- Name: scripconditions_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE scripconditions_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE scripconditions_id_seq FROM root; GRANT ALL ON SEQUENCE scripconditions_id_seq TO root; GRANT ALL ON SEQUENCE scripconditions_id_seq TO rt_user; GRANT SELECT ON SEQUENCE scripconditions_id_seq TO PUBLIC;

-- -- Name: scripconditions; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE scripconditions FROM PUBLIC; REVOKE ALL ON TABLE scripconditions FROM root; GRANT ALL ON TABLE scripconditions TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE scripconditions TO rt_user; GRANT SELECT ON TABLE scripconditions TO PUBLIC;

-- -- Name: scrips_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE scrips_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE scrips_id_seq FROM root; GRANT ALL ON SEQUENCE scrips_id_seq TO root; GRANT ALL ON SEQUENCE scrips_id_seq TO rt_user; GRANT SELECT ON SEQUENCE scrips_id_seq TO PUBLIC;

-- -- Name: scrips; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE scrips FROM PUBLIC; REVOKE ALL ON TABLE scrips FROM root; GRANT ALL ON TABLE scrips TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE scrips TO rt_user; GRANT SELECT ON TABLE scrips TO PUBLIC;

-- -- Name: sessions; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE sessions FROM PUBLIC; REVOKE ALL ON TABLE sessions FROM root; GRANT ALL ON TABLE sessions TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE sessions TO rt_user; GRANT SELECT ON TABLE sessions TO PUBLIC;

-- -- Name: templates_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE templates_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE templates_id_seq FROM root; GRANT ALL ON SEQUENCE templates_id_seq TO root; GRANT ALL ON SEQUENCE templates_id_seq TO rt_user; GRANT SELECT ON SEQUENCE templates_id_seq TO PUBLIC;

-- -- Name: templates; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE templates FROM PUBLIC; REVOKE ALL ON TABLE templates FROM root; GRANT ALL ON TABLE templates TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE templates TO rt_user; GRANT SELECT ON TABLE templates TO PUBLIC;

-- -- Name: tickets_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE tickets_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE tickets_id_seq FROM root; GRANT ALL ON SEQUENCE tickets_id_seq TO root; GRANT ALL ON SEQUENCE tickets_id_seq TO rt_user; GRANT SELECT ON SEQUENCE tickets_id_seq TO PUBLIC;

-- -- Name: tickets; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE tickets FROM PUBLIC; REVOKE ALL ON TABLE tickets FROM root; GRANT ALL ON TABLE tickets TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE tickets TO rt_user; GRANT SELECT ON TABLE tickets TO PUBLIC;

-- -- Name: transactions_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE transactions_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE transactions_id_seq FROM root; GRANT ALL ON SEQUENCE transactions_id_seq TO root; GRANT ALL ON SEQUENCE transactions_id_seq TO rt_user; GRANT SELECT ON SEQUENCE transactions_id_seq TO PUBLIC;

-- -- Name: transactions; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE transactions FROM PUBLIC; REVOKE ALL ON TABLE transactions FROM root; GRANT ALL ON TABLE transactions TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE transactions TO rt_user; GRANT SELECT ON TABLE transactions TO PUBLIC;

-- -- Name: users_id_seq; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON SEQUENCE users_id_seq FROM PUBLIC; REVOKE ALL ON SEQUENCE users_id_seq FROM root; GRANT ALL ON SEQUENCE users_id_seq TO root; GRANT ALL ON SEQUENCE users_id_seq TO rt_user; GRANT SELECT ON SEQUENCE users_id_seq TO PUBLIC;

-- -- Name: users; Type: ACL; Schema: public; Owner: root --

REVOKE ALL ON TABLE users FROM PUBLIC; REVOKE ALL ON TABLE users FROM root; GRANT ALL ON TABLE users TO root; GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE users TO rt_user; GRANT SELECT ON TABLE users TO PUBLIC;

-- -- PostgreSQL database dump complete --

\connect template1

-- -- PostgreSQL database dump --

SET client_encoding = 'UTF8'; SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; SET escape_string_warning = off;

-- -- Name: template1; Type: COMMENT; Schema: -; Owner: postgres --

COMMENT ON DATABASE template1 IS 'Default template database';

-- -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres --

COMMENT ON SCHEMA public IS 'Standard public schema';

-- -- Name: public; Type: ACL; Schema: -; Owner: postgres --

REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC;

-- -- PostgreSQL database dump complete --

-- -- PostgreSQL database cluster dump complete --