Changeset 146a7f3bfbf2f113f1cbdba31a2ba3e575d3e2f8

Show
Ignore:
Timestamp:
09/22/08 18:09:27 (6 years ago)
Author:
Denish Patel <denish@omniti.com>
git-committer:
Denish Patel <denish@omniti.com> 1222106967 +0000
git-parent:

[9f9d948f5f91f25c6ec5d43a5ddcd1143e30fd45]

git-author:
Denish Patel <denish@omniti.com> 1222106967 +0000
Message:

Full database dump

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/reconnoiter_ddl_dump.sql

    r9f9d948 r146a7f3  
    1010 
    1111-- 
    12 -- Name: stratcon; Type: SCHEMA; Schema: -; Owner: reconnoiter 
     12-- Name: prism; Type: SCHEMA; Schema: -; Owner: prism 
     13-- 
     14 
     15CREATE SCHEMA prism; 
     16 
     17 
     18ALTER SCHEMA prism OWNER TO prism; 
     19 
     20-- 
     21-- Name: stratcon; Type: SCHEMA; Schema: -; Owner: stratcon 
    1322-- 
    1423 
     
    1625 
    1726 
    18 ALTER SCHEMA stratcon OWNER TO reconnoiter; 
     27ALTER SCHEMA stratcon OWNER TO stratcon; 
     28 
     29-- 
     30-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: omniti 
     31-- 
     32 
     33CREATE PROCEDURAL LANGUAGE plpgsql; 
     34 
     35 
     36ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO omniti; 
     37 
     38SET search_path = prism, pg_catalog; 
     39 
     40SET default_tablespace = ''; 
     41 
     42SET default_with_oids = false; 
     43 
     44-- 
     45-- Name: saved_graphs; Type: TABLE; Schema: prism; Owner: reconnoiter; Tablespace:  
     46-- 
     47 
     48CREATE TABLE saved_graphs ( 
     49    graphid uuid NOT NULL, 
     50    json text NOT NULL, 
     51    saved boolean DEFAULT false NOT NULL, 
     52    title text, 
     53    last_update timestamp without time zone NOT NULL 
     54); 
     55 
     56 
     57ALTER TABLE prism.saved_graphs OWNER TO reconnoiter; 
     58 
     59-- 
     60-- Name: saved_graphs_dep; Type: TABLE; Schema: prism; Owner: reconnoiter; Tablespace:  
     61-- 
     62 
     63CREATE TABLE saved_graphs_dep ( 
     64    graphid uuid NOT NULL, 
     65    sid integer NOT NULL, 
     66    metric_name text NOT NULL, 
     67    metric_type character varying(22) 
     68); 
     69 
     70 
     71ALTER TABLE prism.saved_graphs_dep OWNER TO reconnoiter; 
     72 
     73SET search_path = public, pg_catalog; 
     74 
     75SET default_with_oids = true; 
     76 
     77-- 
     78-- Name: pga_diagrams; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     79-- 
     80 
     81CREATE TABLE pga_diagrams ( 
     82    diagramname character varying(64) NOT NULL, 
     83    diagramtables text, 
     84    diagramlinks text 
     85); 
     86 
     87 
     88ALTER TABLE public.pga_diagrams OWNER TO reconnoiter; 
     89 
     90-- 
     91-- Name: pga_forms; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     92-- 
     93 
     94CREATE TABLE pga_forms ( 
     95    formname character varying(64) NOT NULL, 
     96    formsource text 
     97); 
     98 
     99 
     100ALTER TABLE public.pga_forms OWNER TO reconnoiter; 
     101 
     102-- 
     103-- Name: pga_graphs; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     104-- 
     105 
     106CREATE TABLE pga_graphs ( 
     107    graphname character varying(64) NOT NULL, 
     108    graphsource text, 
     109    graphcode text 
     110); 
     111 
     112 
     113ALTER TABLE public.pga_graphs OWNER TO reconnoiter; 
     114 
     115-- 
     116-- Name: pga_images; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     117-- 
     118 
     119CREATE TABLE pga_images ( 
     120    imagename character varying(64) NOT NULL, 
     121    imagesource text 
     122); 
     123 
     124 
     125ALTER TABLE public.pga_images OWNER TO reconnoiter; 
     126 
     127-- 
     128-- Name: pga_layout; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     129-- 
     130 
     131CREATE TABLE pga_layout ( 
     132    tablename character varying(64) NOT NULL, 
     133    nrcols smallint, 
     134    colnames text, 
     135    colwidth text 
     136); 
     137 
     138 
     139ALTER TABLE public.pga_layout OWNER TO reconnoiter; 
     140 
     141-- 
     142-- Name: pga_queries; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     143-- 
     144 
     145CREATE TABLE pga_queries ( 
     146    queryname character varying(64) NOT NULL, 
     147    querytype character(1), 
     148    querycommand text, 
     149    querytables text, 
     150    querylinks text, 
     151    queryresults text, 
     152    querycomments text 
     153); 
     154 
     155 
     156ALTER TABLE public.pga_queries OWNER TO reconnoiter; 
     157 
     158-- 
     159-- Name: pga_reports; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     160-- 
     161 
     162CREATE TABLE pga_reports ( 
     163    reportname character varying(64) NOT NULL, 
     164    reportsource text, 
     165    reportbody text, 
     166    reportprocs text, 
     167    reportoptions text 
     168); 
     169 
     170 
     171ALTER TABLE public.pga_reports OWNER TO reconnoiter; 
     172 
     173-- 
     174-- Name: pga_scripts; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     175-- 
     176 
     177CREATE TABLE pga_scripts ( 
     178    scriptname character varying(64) NOT NULL, 
     179    scriptsource text 
     180); 
     181 
     182 
     183ALTER TABLE public.pga_scripts OWNER TO reconnoiter; 
     184 
     185SET default_with_oids = false; 
     186 
     187-- 
     188-- Name: varnish_huh; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     189-- 
     190 
     191CREATE TABLE varnish_huh ( 
     192    sid integer, 
     193    whence timestamp with time zone, 
     194    name text, 
     195    value numeric 
     196); 
     197 
     198 
     199ALTER TABLE public.varnish_huh OWNER TO reconnoiter; 
     200 
     201-- 
     202-- Name: varnish_huh2; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
     203-- 
     204 
     205CREATE TABLE varnish_huh2 ( 
     206    sid integer, 
     207    whence timestamp with time zone, 
     208    name text, 
     209    value numeric 
     210); 
     211 
     212 
     213ALTER TABLE public.varnish_huh2 OWNER TO reconnoiter; 
    19214 
    20215SET search_path = stratcon, pg_catalog; 
    21  
    22 SET default_tablespace = ''; 
    23  
    24 SET default_with_oids = false; 
    25216 
    26217-- 
     
    298489 
    299490ALTER TABLE stratcon.rollup_runner OWNER TO reconnoiter; 
     491 
     492SET search_path = prism, pg_catalog; 
     493 
     494-- 
     495-- Name: check_name_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: reconnoiter 
     496-- 
     497 
     498CREATE FUNCTION check_name_saved_graphs() RETURNS trigger 
     499    AS $$ 
     500DECLARE 
     501BEGIN 
     502    IF  NEW.saved IS true AND NEW.title IS null THEN 
     503    RAISE EXCEPTION 'You must name graph to save'; 
     504    END IF; 
     505 RETURN NEW; 
     506END 
     507$$ 
     508    LANGUAGE plpgsql; 
     509 
     510 
     511ALTER FUNCTION prism.check_name_saved_graphs() OWNER TO reconnoiter; 
     512 
     513SET search_path = public, pg_catalog; 
     514 
     515-- 
     516-- Name: date_hour(timestamp with time zone); Type: FUNCTION; Schema: public; Owner: reconnoiter 
     517-- 
     518 
     519CREATE FUNCTION date_hour(timestamp with time zone) RETURNS timestamp with time zone 
     520    AS $_$ 
     521 SELECT date_trunc('hour',$1); 
     522$_$ 
     523    LANGUAGE sql IMMUTABLE STRICT; 
     524 
     525 
     526ALTER FUNCTION public.date_hour(timestamp with time zone) OWNER TO reconnoiter; 
     527 
     528SET search_path = stratcon, pg_catalog; 
    300529 
    301530-- 
     
    15171746ALTER TABLE stratcon.seq_sid OWNER TO reconnoiter; 
    15181747 
     1748SET search_path = prism, pg_catalog; 
     1749 
     1750-- 
     1751-- Name: saved_graphs_dep_pkey; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace:  
     1752-- 
     1753 
     1754ALTER TABLE ONLY saved_graphs_dep 
     1755    ADD CONSTRAINT saved_graphs_dep_pkey PRIMARY KEY (graphid, sid, metric_name); 
     1756 
     1757 
     1758-- 
     1759-- Name: saved_graphs_pkey; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace:  
     1760-- 
     1761 
     1762ALTER TABLE ONLY saved_graphs 
     1763    ADD CONSTRAINT saved_graphs_pkey PRIMARY KEY (graphid); 
     1764 
     1765 
     1766SET search_path = public, pg_catalog; 
     1767 
     1768-- 
     1769-- Name: pga_diagrams_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1770-- 
     1771 
     1772ALTER TABLE ONLY pga_diagrams 
     1773    ADD CONSTRAINT pga_diagrams_pkey PRIMARY KEY (diagramname); 
     1774 
     1775 
     1776-- 
     1777-- Name: pga_forms_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1778-- 
     1779 
     1780ALTER TABLE ONLY pga_forms 
     1781    ADD CONSTRAINT pga_forms_pkey PRIMARY KEY (formname); 
     1782 
     1783 
     1784-- 
     1785-- Name: pga_graphs_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1786-- 
     1787 
     1788ALTER TABLE ONLY pga_graphs 
     1789    ADD CONSTRAINT pga_graphs_pkey PRIMARY KEY (graphname); 
     1790 
     1791 
     1792-- 
     1793-- Name: pga_images_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1794-- 
     1795 
     1796ALTER TABLE ONLY pga_images 
     1797    ADD CONSTRAINT pga_images_pkey PRIMARY KEY (imagename); 
     1798 
     1799 
     1800-- 
     1801-- Name: pga_layout_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1802-- 
     1803 
     1804ALTER TABLE ONLY pga_layout 
     1805    ADD CONSTRAINT pga_layout_pkey PRIMARY KEY (tablename); 
     1806 
     1807 
     1808-- 
     1809-- Name: pga_queries_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1810-- 
     1811 
     1812ALTER TABLE ONLY pga_queries 
     1813    ADD CONSTRAINT pga_queries_pkey PRIMARY KEY (queryname); 
     1814 
     1815 
     1816-- 
     1817-- Name: pga_reports_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1818-- 
     1819 
     1820ALTER TABLE ONLY pga_reports 
     1821    ADD CONSTRAINT pga_reports_pkey PRIMARY KEY (reportname); 
     1822 
     1823 
     1824-- 
     1825-- Name: pga_scripts_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
     1826-- 
     1827 
     1828ALTER TABLE ONLY pga_scripts 
     1829    ADD CONSTRAINT pga_scripts_pkey PRIMARY KEY (scriptname); 
     1830 
     1831 
     1832SET search_path = stratcon, pg_catalog; 
     1833 
    15191834-- 
    15201835-- Name: current_metric_text_pkey; Type: CONSTRAINT; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     
    17072022CREATE UNIQUE INDEX unq_mv_loading_dock_check_s_id ON mv_loading_dock_check_s USING btree (id); 
    17082023 
     2024 
     2025SET search_path = prism, pg_catalog; 
     2026 
     2027-- 
     2028-- Name: check_name_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter 
     2029-- 
     2030 
     2031CREATE TRIGGER check_name_saved_graphs 
     2032    BEFORE INSERT OR UPDATE ON saved_graphs 
     2033    FOR EACH ROW 
     2034    EXECUTE PROCEDURE check_name_saved_graphs(); 
     2035 
     2036 
     2037SET search_path = stratcon, pg_catalog; 
    17092038 
    17102039-- 
     
    17482077 
    17492078 
    1750 -- 
    1751 -- Name: stratcon; Type: ACL; Schema: -; Owner: reconnoiter 
     2079SET search_path = prism, pg_catalog; 
     2080 
     2081-- 
     2082-- Name: graphid_fk; Type: FK CONSTRAINT; Schema: prism; Owner: reconnoiter 
     2083-- 
     2084 
     2085ALTER TABLE ONLY saved_graphs_dep 
     2086    ADD CONSTRAINT graphid_fk FOREIGN KEY (graphid) REFERENCES saved_graphs(graphid); 
     2087 
     2088 
     2089-- 
     2090-- Name: saved_graphs_dep_sid_fkey; Type: FK CONSTRAINT; Schema: prism; Owner: reconnoiter 
     2091-- 
     2092 
     2093ALTER TABLE ONLY saved_graphs_dep 
     2094    ADD CONSTRAINT saved_graphs_dep_sid_fkey FOREIGN KEY (sid, metric_name, metric_type) REFERENCES stratcon.metric_name_summary(sid, metric_name, metric_type); 
     2095 
     2096 
     2097-- 
     2098-- Name: public; Type: ACL; Schema: -; Owner: postgres 
     2099-- 
     2100 
     2101REVOKE ALL ON SCHEMA public FROM PUBLIC; 
     2102REVOKE ALL ON SCHEMA public FROM postgres; 
     2103GRANT ALL ON SCHEMA public TO postgres; 
     2104GRANT ALL ON SCHEMA public TO PUBLIC; 
     2105 
     2106 
     2107-- 
     2108-- Name: stratcon; Type: ACL; Schema: -; Owner: stratcon 
    17522109-- 
    17532110 
    17542111REVOKE ALL ON SCHEMA stratcon FROM PUBLIC; 
    1755 REVOKE ALL ON SCHEMA stratcon FROM reconnoiter; 
    1756 GRANT ALL ON SCHEMA stratcon TO reconnoiter; 
    1757 GRANT USAGE ON SCHEMA stratcon TO stratcon; 
     2112REVOKE ALL ON SCHEMA stratcon FROM stratcon; 
     2113GRANT ALL ON SCHEMA stratcon TO stratcon; 
    17582114GRANT USAGE ON SCHEMA stratcon TO prism; 
    17592115 
     2116 
     2117-- 
     2118-- Name: saved_graphs; Type: ACL; Schema: prism; Owner: reconnoiter 
     2119-- 
     2120 
     2121REVOKE ALL ON TABLE saved_graphs FROM PUBLIC; 
     2122REVOKE ALL ON TABLE saved_graphs FROM reconnoiter; 
     2123GRANT ALL ON TABLE saved_graphs TO reconnoiter; 
     2124GRANT ALL ON TABLE saved_graphs TO prism; 
     2125 
     2126 
     2127-- 
     2128-- Name: saved_graphs_dep; Type: ACL; Schema: prism; Owner: reconnoiter 
     2129-- 
     2130 
     2131REVOKE ALL ON TABLE saved_graphs_dep FROM PUBLIC; 
     2132REVOKE ALL ON TABLE saved_graphs_dep FROM reconnoiter; 
     2133GRANT ALL ON TABLE saved_graphs_dep TO reconnoiter; 
     2134GRANT ALL ON TABLE saved_graphs_dep TO prism; 
     2135 
     2136 
     2137SET search_path = stratcon, pg_catalog; 
    17602138 
    17612139--