root/sql/tables/prism.saved_graphs.sql

Revision 66c92038a4140676e18fc96716d36bb945eba924, 2.0 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 years ago)

prism tables

  • Property mode set to 100644
Line 
1 --
2 -- Name: saved_graphs; Type: TABLE; Schema: prism; Owner: reconnoiter; Tablespace:
3 --
4
5 CREATE TABLE prism.saved_graphs (
6     graphid uuid NOT NULL,
7     json text NOT NULL,
8     saved boolean DEFAULT false NOT NULL,
9     title text,
10     last_update timestamp without time zone NOT NULL,
11     ts_search_all tsvector,
12     graph_tags text[],
13     genesis text
14 );
15
16
17 ALTER TABLE prism.saved_graphs OWNER TO reconnoiter;
18
19 --
20 -- Name: saved_graphs_pkey; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace:
21 --
22
23 ALTER TABLE ONLY prism.saved_graphs
24     ADD CONSTRAINT saved_graphs_pkey PRIMARY KEY (graphid);
25
26
27 --
28 -- Name: unq_saved_graphs_title; Type: CONSTRAINT; Schema: prism; Owner: reconnoiter; Tablespace:
29 --
30
31 ALTER TABLE ONLY prism.saved_graphs
32     ADD CONSTRAINT unq_saved_graphs_title UNIQUE (title);
33
34
35 --
36 -- Name: idx_saved_graphs_ts_search_all; Type: INDEX; Schema: prism; Owner: reconnoiter; Tablespace:
37 --
38
39 CREATE INDEX idx_saved_graphs_ts_search_all ON prism.saved_graphs USING btree (ts_search_all);
40
41
42 --
43 -- Name: unq_saved_graphs_genesis; Type: INDEX; Schema: prism; Owner: reconnoiter; Tablespace:
44 --
45
46 CREATE INDEX unq_saved_graphs_genesis ON prism.saved_graphs USING btree (genesis);
47
48
49 --
50 -- Name: check_name_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter
51 --
52
53 CREATE TRIGGER check_name_saved_graphs
54     BEFORE INSERT OR UPDATE ON prism.saved_graphs
55     FOR EACH ROW
56     EXECUTE PROCEDURE prism.check_name_saved_graphs();
57
58
59 --
60 -- Name: trig_update_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter
61 --
62
63 CREATE TRIGGER trig_update_tsvector_saved_graphs
64     BEFORE INSERT OR UPDATE ON prism.saved_graphs
65     FOR EACH ROW
66     EXECUTE PROCEDURE prism.trig_update_tsvector_saved_graphs();
67
68
69 --
70 -- Name: saved_graphs; Type: ACL; Schema: prism; Owner: reconnoiter
71 --
72
73 REVOKE ALL ON TABLE prism.saved_graphs FROM PUBLIC;
74 REVOKE ALL ON TABLE prism.saved_graphs FROM reconnoiter;
75 GRANT ALL ON TABLE prism.saved_graphs TO reconnoiter;
76 GRANT ALL ON TABLE prism.saved_graphs TO prism;
77
Note: See TracBrowser for help on using the browser.