Changeset 515
- Timestamp:
- 11/04/08 15:23:11 (2 months ago)
- Files:
-
- trunk/sql/reconnoiter_ddl_dump.sql (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/sql/reconnoiter_ddl_dump.sql
r502 r515 41 41 42 42 SET default_with_oids = false; 43 44 -- 45 -- Name: graph_templates; Type: TABLE; Schema: prism; Owner: reconnoiter; Tablespace: 46 -- 47 48 CREATE TABLE graph_templates ( 49 templateid uuid NOT NULL, 50 title text NOT NULL, 51 json text NOT NULL 52 ); 53 54 55 ALTER TABLE prism.graph_templates OWNER TO reconnoiter; 43 56 44 57 -- … … 746 759 747 760 -- 748 -- Name: trig_before_tsvector_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: postgres749 --750 751 CREATE FUNCTION trig_before_tsvector_saved_graphs() RETURNS trigger752 AS $$753 DECLARE754 BEGIN755 NEW.ts_search_all:= to_tsvector(NEW.title);756 RETURN NEW;757 END758 $$759 LANGUAGE plpgsql;760 761 762 ALTER FUNCTION prism.trig_before_tsvector_saved_graphs() OWNER TO postgres;763 764 --765 761 -- Name: trig_update_tsvector_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: reconnoiter 766 762 -- … … 770 766 DECLARE 771 767 BEGIN 768 IF TG_OP = 'UPDATE' THEN 772 769 IF (NEW.graph_tags <> OLD.graph_tags OR NEW.title <> OLD.title) THEN 773 UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=NEW.graphid;770 NEW.ts_search_all=prism.saved_graphs_tsvector(NEW.graphid); 774 771 END IF; 772 ELSE 773 NEW.ts_search_all = to_tsvector(NEW.title); 774 END IF; 775 775 RETURN NEW; 776 776 END … … 2167 2167 2168 2168 -- 2169 -- Name: graph_templates_pkey; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace: 2170 -- 2171 2172 ALTER TABLE ONLY graph_templates 2173 ADD CONSTRAINT graph_templates_pkey PRIMARY KEY (templateid); 2174 2175 2176 -- 2177 -- Name: graph_templates_title_key; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace: 2178 -- 2179 2180 ALTER TABLE ONLY graph_templates 2181 ADD CONSTRAINT graph_templates_title_key UNIQUE (title); 2182 2183 2184 -- 2169 2185 -- Name: saved_graphs_dep_pkey; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace: 2170 2186 -- … … 2180 2196 ALTER TABLE ONLY saved_graphs 2181 2197 ADD CONSTRAINT saved_graphs_pkey PRIMARY KEY (graphid); 2198 2199 2200 -- 2201 -- Name: saved_graphs_title_key; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace: 2202 -- 2203 2204 ALTER TABLE ONLY saved_graphs 2205 ADD CONSTRAINT saved_graphs_title_key UNIQUE (title); 2182 2206 2183 2207 … … 2488 2512 2489 2513 -- 2490 -- Name: trig_before_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter2491 --2492 2493 CREATE TRIGGER trig_before_tsvector_saved_graphs2494 BEFORE INSERT ON saved_graphs2495 FOR EACH ROW2496 EXECUTE PROCEDURE trig_before_tsvector_saved_graphs();2497 2498 2499 --2500 2514 -- Name: trig_update_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter 2501 2515 -- 2502 2516 2503 2517 CREATE TRIGGER trig_update_tsvector_saved_graphs 2504 AFTER UPDATE ON saved_graphs2518 BEFORE INSERT OR UPDATE ON saved_graphs 2505 2519 FOR EACH ROW 2506 2520 EXECUTE PROCEDURE trig_update_tsvector_saved_graphs(); … … 2582 2596 2583 2597 -- 2584 -- Name: graphid_fk; Type: FK CONSTRAINT; Schema: prism; Owner: reconnoiter2598 -- Name: saved_graphs_dep_graphid_fkey; Type: FK CONSTRAINT; Schema: prism; Owner: reconnoiter 2585 2599 -- 2586 2600 2587 2601 ALTER TABLE ONLY saved_graphs_dep 2588 ADD CONSTRAINT graphid_fk FOREIGN KEY (graphid) REFERENCES saved_graphs(graphid);2602 ADD CONSTRAINT saved_graphs_dep_graphid_fkey FOREIGN KEY (graphid) REFERENCES saved_graphs(graphid) ON DELETE CASCADE; 2589 2603 2590 2604 … … 2634 2648 2635 2649 -- 2650 -- Name: graph_templates; Type: ACL; Schema: prism; Owner: reconnoiter 2651 -- 2652 2653 REVOKE ALL ON TABLE graph_templates FROM PUBLIC; 2654 REVOKE ALL ON TABLE graph_templates FROM reconnoiter; 2655 GRANT ALL ON TABLE graph_templates TO reconnoiter; 2656 GRANT ALL ON TABLE graph_templates TO prism; 2657 2658 2659 -- 2636 2660 -- Name: saved_graphs; Type: ACL; Schema: prism; Owner: reconnoiter 2637 2661 -- … … 2651 2675 GRANT ALL ON TABLE saved_graphs_dep TO reconnoiter; 2652 2676 GRANT ALL ON TABLE saved_graphs_dep TO prism; 2677 2678 2679 -- 2680 -- Name: saved_worksheets; Type: ACL; Schema: prism; Owner: reconnoiter 2681 -- 2682 2683 REVOKE ALL ON TABLE saved_worksheets FROM PUBLIC; 2684 REVOKE ALL ON TABLE saved_worksheets FROM reconnoiter; 2685 GRANT ALL ON TABLE saved_worksheets TO reconnoiter; 2686 GRANT ALL ON TABLE saved_worksheets TO prism; 2687 2688 2689 -- 2690 -- Name: saved_worksheets_dep; Type: ACL; Schema: prism; Owner: reconnoiter 2691 -- 2692 2693 REVOKE ALL ON TABLE saved_worksheets_dep FROM PUBLIC; 2694 REVOKE ALL ON TABLE saved_worksheets_dep FROM reconnoiter; 2695 GRANT ALL ON TABLE saved_worksheets_dep TO reconnoiter; 2696 GRANT ALL ON TABLE saved_worksheets_dep TO prism; 2653 2697 2654 2698
