--
--


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

COMMENT ON SCHEMA public IS 'Standard public schema';





--
-- Name: agilo_backlog; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_backlog (
    description text,
    name text NOT NULL,
    sorting_keys text,
    ticket_types text,
    b_type integer
);


ALTER TABLE public.agilo_backlog OWNER TO trac;

--
-- Name: agilo_backlog_ticket; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_backlog_ticket (
    name text NOT NULL,
    pos integer,
    scope text NOT NULL,
    ticket_id integer NOT NULL
);


ALTER TABLE public.agilo_backlog_ticket OWNER TO trac;

--
-- Name: agilo_burndown; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_burndown (
    task_id integer NOT NULL,
    date integer NOT NULL,
    remaining_time real
);


ALTER TABLE public.agilo_burndown OWNER TO trac;

--
-- Name: agilo_burndown_data_change; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_burndown_data_change (
    id serial NOT NULL,
    scope text,
    burndown_type text,
    value text,
    "timestamp" integer
);


ALTER TABLE public.agilo_burndown_data_change OWNER TO trac;

--
-- Name: agilo_calendar_entry; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_calendar_entry (
    date integer NOT NULL,
    hours real,
    teammember text NOT NULL
);


ALTER TABLE public.agilo_calendar_entry OWNER TO trac;

--
-- Name: agilo_contingent; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_contingent (
    actual real,
    amount real,
    name text NOT NULL,
    sprint text NOT NULL
);


ALTER TABLE public.agilo_contingent OWNER TO trac;

--
-- Name: agilo_link; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_link (
    src integer NOT NULL,
    dest integer NOT NULL
);


ALTER TABLE public.agilo_link OWNER TO trac;

--
-- Name: agilo_sprint; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_sprint (
    description text,
    sprint_end integer,
    milestone text,
    name text NOT NULL,
    "start" integer,
    team text
);


ALTER TABLE public.agilo_sprint OWNER TO trac;

--
-- Name: agilo_team; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_team (
    description text,
    name text NOT NULL
);


ALTER TABLE public.agilo_team OWNER TO trac;

--
-- Name: agilo_team_member; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_team_member (
    description text,
    name text NOT NULL,
    team text,
    ts_fri real,
    ts_mon real,
    ts_sat real,
    ts_sun real,
    ts_thu real,
    ts_tue real,
    ts_wed real
);


ALTER TABLE public.agilo_team_member OWNER TO trac;

--
-- Name: agilo_team_metrics_entry; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE agilo_team_metrics_entry (
    metrics_key text NOT NULL,
    sprint text NOT NULL,
    team text NOT NULL,
    value real
);


ALTER TABLE public.agilo_team_metrics_entry OWNER TO trac;

--
-- Name: attachment; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE attachment (
    "type" text NOT NULL,
    id text NOT NULL,
    filename text NOT NULL,
    size integer,
    "time" integer,
    description text,
    author text,
    ipnr text
);


ALTER TABLE public.attachment OWNER TO trac;

--
-- Name: auth_cookie; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE auth_cookie (
    cookie text NOT NULL,
    name text NOT NULL,
    ipnr text NOT NULL,
    "time" integer
);


ALTER TABLE public.auth_cookie OWNER TO trac;

--
-- Name: component; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE component (
    name text NOT NULL,
    "owner" text,
    description text
);


ALTER TABLE public.component OWNER TO trac;

--
-- Name: enum; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE enum (
    "type" text NOT NULL,
    name text NOT NULL,
    value text
);


ALTER TABLE public.enum OWNER TO trac;

--
-- Name: milestone; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE milestone (
    name text NOT NULL,
    due integer,
    completed integer,
    description text
);


ALTER TABLE public.milestone OWNER TO trac;

--
-- Name: node_change; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE node_change (
    rev text NOT NULL,
    path text NOT NULL,
    node_type text,
    change_type text NOT NULL,
    base_path text,
    base_rev text
);


ALTER TABLE public.node_change OWNER TO trac;

--
-- Name: permission; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE permission (
    username text NOT NULL,
    "action" text NOT NULL
);


ALTER TABLE public.permission OWNER TO trac;

--
-- Name: report; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE report (
    id serial NOT NULL,
    author text,
    title text,
    query text,
    description text
);


ALTER TABLE public.report OWNER TO trac;

--
-- Name: revision; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE revision (
    rev text NOT NULL,
    "time" integer,
    author text,
    message text
);


ALTER TABLE public.revision OWNER TO trac;

--
-- Name: session; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE "session" (
    sid text NOT NULL,
    authenticated integer NOT NULL,
    last_visit integer
);


ALTER TABLE public."session" OWNER TO trac;

--
-- Name: session_attribute; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE session_attribute (
    sid text NOT NULL,
    authenticated integer NOT NULL,
    name text NOT NULL,
    value text
);


ALTER TABLE public.session_attribute OWNER TO trac;

--
-- Name: subtickets; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE subtickets (
    parent text NOT NULL,
    child text NOT NULL
);


ALTER TABLE public.subtickets OWNER TO trac;

--
-- Name: system; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE "system" (
    name text NOT NULL,
    value text
);


ALTER TABLE public."system" OWNER TO trac;

--
-- Name: ticket; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE ticket (
    id serial NOT NULL,
    "type" text,
    "time" integer,
    changetime integer,
    component text,
    severity text,
    priority text,
    "owner" text,
    reporter text,
    cc text,
    version text,
    milestone text,
    status text,
    resolution text,
    summary text,
    description text,
    keywords text
);


ALTER TABLE public.ticket OWNER TO trac;

--
-- Name: ticket_change; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE ticket_change (
    ticket integer NOT NULL,
    "time" integer NOT NULL,
    author text,
    field text NOT NULL,
    oldvalue text,
    newvalue text
);


ALTER TABLE public.ticket_change OWNER TO trac;

--
-- Name: ticket_custom; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE ticket_custom (
    ticket integer NOT NULL,
    name text NOT NULL,
    value text
);


ALTER TABLE public.ticket_custom OWNER TO trac;

--
-- Name: version; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE version (
    name text NOT NULL,
    "time" integer,
    description text
);


ALTER TABLE public.version OWNER TO trac;

--
-- Name: wiki; Type: TABLE; Schema: public; Owner: trac; Tablespace: 
--

CREATE TABLE wiki (
    name text NOT NULL,
    version integer NOT NULL,
    "time" integer,
    author text,
    ipnr text,
    text text,
    "comment" text,
    readonly integer
);


ALTER TABLE public.wiki OWNER TO trac;

--
-- Name: agilo_backlog_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_backlog
    ADD CONSTRAINT agilo_backlog_pkey PRIMARY KEY (name);


--
-- Name: agilo_backlog_ticket_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_backlog_ticket
    ADD CONSTRAINT agilo_backlog_ticket_pk PRIMARY KEY (name, scope, ticket_id);


--
-- Name: agilo_burndown_data_change_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_burndown_data_change
    ADD CONSTRAINT agilo_burndown_data_change_pkey PRIMARY KEY (id);


--
-- Name: agilo_burndown_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_burndown
    ADD CONSTRAINT agilo_burndown_pk PRIMARY KEY (task_id, date);


--
-- Name: agilo_calendar_entry_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_calendar_entry
    ADD CONSTRAINT agilo_calendar_entry_pk PRIMARY KEY (date, teammember);


--
-- Name: agilo_contingent_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_contingent
    ADD CONSTRAINT agilo_contingent_pk PRIMARY KEY (name, sprint);


--
-- Name: agilo_link_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_link
    ADD CONSTRAINT agilo_link_pk PRIMARY KEY (src, dest);


--
-- Name: agilo_sprint_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_sprint
    ADD CONSTRAINT agilo_sprint_pkey PRIMARY KEY (name);


--
-- Name: agilo_team_member_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_team_member
    ADD CONSTRAINT agilo_team_member_pkey PRIMARY KEY (name);


--
-- Name: agilo_team_metrics_entry_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_team_metrics_entry
    ADD CONSTRAINT agilo_team_metrics_entry_pk PRIMARY KEY (metrics_key, sprint, team);


--
-- Name: agilo_team_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY agilo_team
    ADD CONSTRAINT agilo_team_pkey PRIMARY KEY (name);


--
-- Name: attachment_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY attachment
    ADD CONSTRAINT attachment_pk PRIMARY KEY ("type", id, filename);


--
-- Name: auth_cookie_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY auth_cookie
    ADD CONSTRAINT auth_cookie_pk PRIMARY KEY (cookie, ipnr, name);


--
-- Name: component_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY component
    ADD CONSTRAINT component_pkey PRIMARY KEY (name);


--
-- Name: enum_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY enum
    ADD CONSTRAINT enum_pk PRIMARY KEY ("type", name);


--
-- Name: milestone_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY milestone
    ADD CONSTRAINT milestone_pkey PRIMARY KEY (name);


--
-- Name: node_change_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY node_change
    ADD CONSTRAINT node_change_pk PRIMARY KEY (rev, path, change_type);


--
-- Name: permission_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY permission
    ADD CONSTRAINT permission_pk PRIMARY KEY (username, "action");


--
-- Name: report_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY report
    ADD CONSTRAINT report_pkey PRIMARY KEY (id);


--
-- Name: revision_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY revision
    ADD CONSTRAINT revision_pkey PRIMARY KEY (rev);


--
-- Name: session_attribute_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY session_attribute
    ADD CONSTRAINT session_attribute_pk PRIMARY KEY (sid, authenticated, name);


--
-- Name: session_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY "session"
    ADD CONSTRAINT session_pk PRIMARY KEY (sid, authenticated);


--
-- Name: subtickets_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY subtickets
    ADD CONSTRAINT subtickets_pk PRIMARY KEY (parent, child);


--
-- Name: system_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY "system"
    ADD CONSTRAINT system_pkey PRIMARY KEY (name);


--
-- Name: ticket_change_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY ticket_change
    ADD CONSTRAINT ticket_change_pk PRIMARY KEY (ticket, "time", field);


--
-- Name: ticket_custom_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY ticket_custom
    ADD CONSTRAINT ticket_custom_pk PRIMARY KEY (ticket, name);


--
-- Name: ticket_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY ticket
    ADD CONSTRAINT ticket_pkey PRIMARY KEY (id);


--
-- Name: version_pkey; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY version
    ADD CONSTRAINT version_pkey PRIMARY KEY (name);


--
-- Name: wiki_pk; Type: CONSTRAINT; Schema: public; Owner: trac; Tablespace: 
--

ALTER TABLE ONLY wiki
    ADD CONSTRAINT wiki_pk PRIMARY KEY (name, version);


--
-- Name: node_change_rev_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX node_change_rev_idx ON node_change USING btree (rev);


--
-- Name: revision_time_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX revision_time_idx ON revision USING btree ("time");


--
-- Name: session_authenticated_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX session_authenticated_idx ON "session" USING btree (authenticated);


--
-- Name: session_last_visit_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX session_last_visit_idx ON "session" USING btree (last_visit);


--
-- Name: ticket_change_ticket_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX ticket_change_ticket_idx ON ticket_change USING btree (ticket);


--
-- Name: ticket_change_time_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX ticket_change_time_idx ON ticket_change USING btree ("time");


--
-- Name: ticket_status_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX ticket_status_idx ON ticket USING btree (status);


--
-- Name: ticket_time_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX ticket_time_idx ON ticket USING btree ("time");


--
-- Name: wiki_time_idx; Type: INDEX; Schema: public; Owner: trac; Tablespace: 
--

CREATE INDEX wiki_time_idx ON wiki USING btree ("time");


--
-- 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: attachment; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE attachment FROM PUBLIC;
REVOKE ALL ON TABLE attachment FROM trac;
GRANT ALL ON TABLE attachment TO trac;
GRANT SELECT ON TABLE attachment TO pcaep;


--
-- Name: auth_cookie; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE auth_cookie FROM PUBLIC;
REVOKE ALL ON TABLE auth_cookie FROM trac;
GRANT ALL ON TABLE auth_cookie TO trac;
GRANT SELECT ON TABLE auth_cookie TO pcaep;


--
-- Name: component; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE component FROM PUBLIC;
REVOKE ALL ON TABLE component FROM trac;
GRANT ALL ON TABLE component TO trac;
GRANT SELECT ON TABLE component TO pcaep;


--
-- Name: enum; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE enum FROM PUBLIC;
REVOKE ALL ON TABLE enum FROM trac;
GRANT ALL ON TABLE enum TO trac;
GRANT SELECT ON TABLE enum TO pcaep;


--
-- Name: milestone; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE milestone FROM PUBLIC;
REVOKE ALL ON TABLE milestone FROM trac;
GRANT ALL ON TABLE milestone TO trac;
GRANT SELECT ON TABLE milestone TO pcaep;


--
-- Name: node_change; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE node_change FROM PUBLIC;
REVOKE ALL ON TABLE node_change FROM trac;
GRANT ALL ON TABLE node_change TO trac;
GRANT SELECT ON TABLE node_change TO pcaep;


--
-- Name: permission; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE permission FROM PUBLIC;
REVOKE ALL ON TABLE permission FROM trac;
GRANT ALL ON TABLE permission TO trac;
GRANT SELECT ON TABLE permission TO pcaep;


--
-- Name: report; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE report FROM PUBLIC;
REVOKE ALL ON TABLE report FROM trac;
GRANT ALL ON TABLE report TO trac;
GRANT SELECT ON TABLE report TO pcaep;


--
-- Name: revision; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE revision FROM PUBLIC;
REVOKE ALL ON TABLE revision FROM trac;
GRANT ALL ON TABLE revision TO trac;
GRANT SELECT ON TABLE revision TO pcaep;


--
-- Name: session; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE "session" FROM PUBLIC;
REVOKE ALL ON TABLE "session" FROM trac;
GRANT ALL ON TABLE "session" TO trac;
GRANT SELECT ON TABLE "session" TO pcaep;


--
-- Name: session_attribute; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE session_attribute FROM PUBLIC;
REVOKE ALL ON TABLE session_attribute FROM trac;
GRANT ALL ON TABLE session_attribute TO trac;
GRANT SELECT ON TABLE session_attribute TO pcaep;


--
-- Name: subtickets; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE subtickets FROM PUBLIC;
REVOKE ALL ON TABLE subtickets FROM trac;
GRANT ALL ON TABLE subtickets TO trac;
GRANT SELECT ON TABLE subtickets TO pcaep;


--
-- Name: system; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE "system" FROM PUBLIC;
REVOKE ALL ON TABLE "system" FROM trac;
GRANT ALL ON TABLE "system" TO trac;
GRANT SELECT ON TABLE "system" TO pcaep;


--
-- Name: ticket; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE ticket FROM PUBLIC;
REVOKE ALL ON TABLE ticket FROM trac;
GRANT ALL ON TABLE ticket TO trac;
GRANT SELECT ON TABLE ticket TO pcaep;


--
-- Name: ticket_change; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE ticket_change FROM PUBLIC;
REVOKE ALL ON TABLE ticket_change FROM trac;
GRANT ALL ON TABLE ticket_change TO trac;
GRANT SELECT ON TABLE ticket_change TO pcaep;


--
-- Name: ticket_custom; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE ticket_custom FROM PUBLIC;
REVOKE ALL ON TABLE ticket_custom FROM trac;
GRANT ALL ON TABLE ticket_custom TO trac;
GRANT SELECT ON TABLE ticket_custom TO pcaep;


--
-- Name: version; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE version FROM PUBLIC;
REVOKE ALL ON TABLE version FROM trac;
GRANT ALL ON TABLE version TO trac;
GRANT SELECT ON TABLE version TO pcaep;


--
-- Name: wiki; Type: ACL; Schema: public; Owner: trac
--

REVOKE ALL ON TABLE wiki FROM PUBLIC;
REVOKE ALL ON TABLE wiki FROM trac;
GRANT ALL ON TABLE wiki TO trac;
GRANT SELECT ON TABLE wiki TO pcaep;


--
--

