Synch schema with reality.
[cocanwiki.git] / cocanwiki.sql
1 --
2 -- PostgreSQL database dump
3 --
4
5 SET client_encoding = 'UNICODE';
6 SET check_function_bodies = false;
7
8 --
9 -- TOC entry 4 (OID 2200)
10 -- Name: public; Type: ACL; Schema: -; Owner: postgres
11 --
12
13 REVOKE ALL ON SCHEMA public FROM PUBLIC;
14 REVOKE ALL ON SCHEMA public FROM postgres;
15 GRANT ALL ON SCHEMA public TO PUBLIC;
16
17
18 SET search_path = public, pg_catalog;
19
20 --
21 -- TOC entry 12 (OID 11524567)
22 -- Name: pg_ts_dict; Type: TABLE; Schema: public; Owner: postgres
23 --
24
25 CREATE TABLE pg_ts_dict (
26     dict_name text NOT NULL,
27     dict_init oid,
28     dict_initoption text,
29     dict_lexize oid NOT NULL,
30     dict_comment text
31 );
32
33
34 --
35 -- TOC entry 13 (OID 11524567)
36 -- Name: pg_ts_dict; Type: ACL; Schema: public; Owner: postgres
37 --
38
39 REVOKE ALL ON TABLE pg_ts_dict FROM PUBLIC;
40 GRANT SELECT ON TABLE pg_ts_dict TO rich;
41 GRANT SELECT ON TABLE pg_ts_dict TO "www-data";
42
43
44 --
45 -- TOC entry 116 (OID 11524574)
46 -- Name: lexize(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
47 --
48
49 CREATE FUNCTION lexize(oid, text) RETURNS text[]
50     AS '$libdir/tsearch2', 'lexize'
51     LANGUAGE c STRICT;
52
53
54 --
55 -- TOC entry 117 (OID 11524575)
56 -- Name: lexize(text, text); Type: FUNCTION; Schema: public; Owner: postgres
57 --
58
59 CREATE FUNCTION lexize(text, text) RETURNS text[]
60     AS '$libdir/tsearch2', 'lexize_byname'
61     LANGUAGE c STRICT;
62
63
64 --
65 -- TOC entry 118 (OID 11524576)
66 -- Name: lexize(text); Type: FUNCTION; Schema: public; Owner: postgres
67 --
68
69 CREATE FUNCTION lexize(text) RETURNS text[]
70     AS '$libdir/tsearch2', 'lexize_bycurrent'
71     LANGUAGE c STRICT;
72
73
74 --
75 -- TOC entry 119 (OID 11524577)
76 -- Name: set_curdict(integer); Type: FUNCTION; Schema: public; Owner: postgres
77 --
78
79 CREATE FUNCTION set_curdict(integer) RETURNS void
80     AS '$libdir/tsearch2', 'set_curdict'
81     LANGUAGE c STRICT;
82
83
84 --
85 -- TOC entry 120 (OID 11524578)
86 -- Name: set_curdict(text); Type: FUNCTION; Schema: public; Owner: postgres
87 --
88
89 CREATE FUNCTION set_curdict(text) RETURNS void
90     AS '$libdir/tsearch2', 'set_curdict_byname'
91     LANGUAGE c STRICT;
92
93
94 --
95 -- TOC entry 121 (OID 11524579)
96 -- Name: dex_init(internal); Type: FUNCTION; Schema: public; Owner: postgres
97 --
98
99 CREATE FUNCTION dex_init(internal) RETURNS internal
100     AS '$libdir/tsearch2', 'dex_init'
101     LANGUAGE c;
102
103
104 --
105 -- TOC entry 122 (OID 11524580)
106 -- Name: dex_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
107 --
108
109 CREATE FUNCTION dex_lexize(internal, internal, integer) RETURNS internal
110     AS '$libdir/tsearch2', 'dex_lexize'
111     LANGUAGE c STRICT;
112
113
114 --
115 -- TOC entry 123 (OID 11524582)
116 -- Name: snb_en_init(internal); Type: FUNCTION; Schema: public; Owner: postgres
117 --
118
119 CREATE FUNCTION snb_en_init(internal) RETURNS internal
120     AS '$libdir/tsearch2', 'snb_en_init'
121     LANGUAGE c;
122
123
124 --
125 -- TOC entry 124 (OID 11524583)
126 -- Name: snb_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
127 --
128
129 CREATE FUNCTION snb_lexize(internal, internal, integer) RETURNS internal
130     AS '$libdir/tsearch2', 'snb_lexize'
131     LANGUAGE c STRICT;
132
133
134 --
135 -- TOC entry 125 (OID 11524585)
136 -- Name: snb_ru_init(internal); Type: FUNCTION; Schema: public; Owner: postgres
137 --
138
139 CREATE FUNCTION snb_ru_init(internal) RETURNS internal
140     AS '$libdir/tsearch2', 'snb_ru_init'
141     LANGUAGE c;
142
143
144 --
145 -- TOC entry 126 (OID 11524587)
146 -- Name: spell_init(internal); Type: FUNCTION; Schema: public; Owner: postgres
147 --
148
149 CREATE FUNCTION spell_init(internal) RETURNS internal
150     AS '$libdir/tsearch2', 'spell_init'
151     LANGUAGE c;
152
153
154 --
155 -- TOC entry 127 (OID 11524588)
156 -- Name: spell_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
157 --
158
159 CREATE FUNCTION spell_lexize(internal, internal, integer) RETURNS internal
160     AS '$libdir/tsearch2', 'spell_lexize'
161     LANGUAGE c STRICT;
162
163
164 --
165 -- TOC entry 128 (OID 11524590)
166 -- Name: syn_init(internal); Type: FUNCTION; Schema: public; Owner: postgres
167 --
168
169 CREATE FUNCTION syn_init(internal) RETURNS internal
170     AS '$libdir/tsearch2', 'syn_init'
171     LANGUAGE c;
172
173
174 --
175 -- TOC entry 129 (OID 11524591)
176 -- Name: syn_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
177 --
178
179 CREATE FUNCTION syn_lexize(internal, internal, integer) RETURNS internal
180     AS '$libdir/tsearch2', 'syn_lexize'
181     LANGUAGE c STRICT;
182
183
184 --
185 -- TOC entry 14 (OID 11524593)
186 -- Name: pg_ts_parser; Type: TABLE; Schema: public; Owner: postgres
187 --
188
189 CREATE TABLE pg_ts_parser (
190     prs_name text NOT NULL,
191     prs_start oid NOT NULL,
192     prs_nexttoken oid NOT NULL,
193     prs_end oid NOT NULL,
194     prs_headline oid NOT NULL,
195     prs_lextype oid NOT NULL,
196     prs_comment text
197 );
198
199
200 --
201 -- TOC entry 15 (OID 11524593)
202 -- Name: pg_ts_parser; Type: ACL; Schema: public; Owner: postgres
203 --
204
205 REVOKE ALL ON TABLE pg_ts_parser FROM PUBLIC;
206 GRANT SELECT ON TABLE pg_ts_parser TO rich;
207 GRANT SELECT ON TABLE pg_ts_parser TO "www-data";
208
209
210 --
211 -- TOC entry 5 (OID 11524601)
212 -- Name: tokentype; Type: TYPE; Schema: public; Owner: postgres
213 --
214
215 CREATE TYPE tokentype AS (
216         tokid integer,
217         alias text,
218         descr text
219 );
220
221
222 --
223 -- TOC entry 130 (OID 11524602)
224 -- Name: token_type(integer); Type: FUNCTION; Schema: public; Owner: postgres
225 --
226
227 CREATE FUNCTION token_type(integer) RETURNS SETOF tokentype
228     AS '$libdir/tsearch2', 'token_type'
229     LANGUAGE c STRICT;
230
231
232 --
233 -- TOC entry 131 (OID 11524603)
234 -- Name: token_type(text); Type: FUNCTION; Schema: public; Owner: postgres
235 --
236
237 CREATE FUNCTION token_type(text) RETURNS SETOF tokentype
238     AS '$libdir/tsearch2', 'token_type_byname'
239     LANGUAGE c STRICT;
240
241
242 --
243 -- TOC entry 132 (OID 11524604)
244 -- Name: token_type(); Type: FUNCTION; Schema: public; Owner: postgres
245 --
246
247 CREATE FUNCTION token_type() RETURNS SETOF tokentype
248     AS '$libdir/tsearch2', 'token_type_current'
249     LANGUAGE c STRICT;
250
251
252 --
253 -- TOC entry 133 (OID 11524605)
254 -- Name: set_curprs(integer); Type: FUNCTION; Schema: public; Owner: postgres
255 --
256
257 CREATE FUNCTION set_curprs(integer) RETURNS void
258     AS '$libdir/tsearch2', 'set_curprs'
259     LANGUAGE c STRICT;
260
261
262 --
263 -- TOC entry 134 (OID 11524606)
264 -- Name: set_curprs(text); Type: FUNCTION; Schema: public; Owner: postgres
265 --
266
267 CREATE FUNCTION set_curprs(text) RETURNS void
268     AS '$libdir/tsearch2', 'set_curprs_byname'
269     LANGUAGE c STRICT;
270
271
272 --
273 -- TOC entry 6 (OID 11524608)
274 -- Name: tokenout; Type: TYPE; Schema: public; Owner: postgres
275 --
276
277 CREATE TYPE tokenout AS (
278         tokid integer,
279         token text
280 );
281
282
283 --
284 -- TOC entry 135 (OID 11524609)
285 -- Name: parse(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
286 --
287
288 CREATE FUNCTION parse(oid, text) RETURNS SETOF tokenout
289     AS '$libdir/tsearch2', 'parse'
290     LANGUAGE c STRICT;
291
292
293 --
294 -- TOC entry 136 (OID 11524610)
295 -- Name: parse(text, text); Type: FUNCTION; Schema: public; Owner: postgres
296 --
297
298 CREATE FUNCTION parse(text, text) RETURNS SETOF tokenout
299     AS '$libdir/tsearch2', 'parse_byname'
300     LANGUAGE c STRICT;
301
302
303 --
304 -- TOC entry 137 (OID 11524611)
305 -- Name: parse(text); Type: FUNCTION; Schema: public; Owner: postgres
306 --
307
308 CREATE FUNCTION parse(text) RETURNS SETOF tokenout
309     AS '$libdir/tsearch2', 'parse_current'
310     LANGUAGE c STRICT;
311
312
313 --
314 -- TOC entry 138 (OID 11524612)
315 -- Name: prsd_start(internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
316 --
317
318 CREATE FUNCTION prsd_start(internal, integer) RETURNS internal
319     AS '$libdir/tsearch2', 'prsd_start'
320     LANGUAGE c;
321
322
323 --
324 -- TOC entry 139 (OID 11524613)
325 -- Name: prsd_getlexeme(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
326 --
327
328 CREATE FUNCTION prsd_getlexeme(internal, internal, internal) RETURNS integer
329     AS '$libdir/tsearch2', 'prsd_getlexeme'
330     LANGUAGE c;
331
332
333 --
334 -- TOC entry 140 (OID 11524614)
335 -- Name: prsd_end(internal); Type: FUNCTION; Schema: public; Owner: postgres
336 --
337
338 CREATE FUNCTION prsd_end(internal) RETURNS void
339     AS '$libdir/tsearch2', 'prsd_end'
340     LANGUAGE c;
341
342
343 --
344 -- TOC entry 141 (OID 11524615)
345 -- Name: prsd_lextype(internal); Type: FUNCTION; Schema: public; Owner: postgres
346 --
347
348 CREATE FUNCTION prsd_lextype(internal) RETURNS internal
349     AS '$libdir/tsearch2', 'prsd_lextype'
350     LANGUAGE c;
351
352
353 --
354 -- TOC entry 142 (OID 11524616)
355 -- Name: prsd_headline(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
356 --
357
358 CREATE FUNCTION prsd_headline(internal, internal, internal) RETURNS internal
359     AS '$libdir/tsearch2', 'prsd_headline'
360     LANGUAGE c;
361
362
363 --
364 -- TOC entry 16 (OID 11524618)
365 -- Name: pg_ts_cfg; Type: TABLE; Schema: public; Owner: postgres
366 --
367
368 CREATE TABLE pg_ts_cfg (
369     ts_name text NOT NULL,
370     prs_name text NOT NULL,
371     locale text
372 );
373
374
375 --
376 -- TOC entry 17 (OID 11524618)
377 -- Name: pg_ts_cfg; Type: ACL; Schema: public; Owner: postgres
378 --
379
380 REVOKE ALL ON TABLE pg_ts_cfg FROM PUBLIC;
381 GRANT SELECT ON TABLE pg_ts_cfg TO rich;
382 GRANT SELECT ON TABLE pg_ts_cfg TO "www-data";
383
384
385 --
386 -- TOC entry 18 (OID 11524625)
387 -- Name: pg_ts_cfgmap; Type: TABLE; Schema: public; Owner: postgres
388 --
389
390 CREATE TABLE pg_ts_cfgmap (
391     ts_name text NOT NULL,
392     tok_alias text NOT NULL,
393     dict_name text[]
394 );
395
396
397 --
398 -- TOC entry 19 (OID 11524625)
399 -- Name: pg_ts_cfgmap; Type: ACL; Schema: public; Owner: postgres
400 --
401
402 REVOKE ALL ON TABLE pg_ts_cfgmap FROM PUBLIC;
403 GRANT SELECT ON TABLE pg_ts_cfgmap TO rich;
404 GRANT SELECT ON TABLE pg_ts_cfgmap TO "www-data";
405
406
407 --
408 -- TOC entry 143 (OID 11524632)
409 -- Name: set_curcfg(integer); Type: FUNCTION; Schema: public; Owner: postgres
410 --
411
412 CREATE FUNCTION set_curcfg(integer) RETURNS void
413     AS '$libdir/tsearch2', 'set_curcfg'
414     LANGUAGE c STRICT;
415
416
417 --
418 -- TOC entry 144 (OID 11524633)
419 -- Name: set_curcfg(text); Type: FUNCTION; Schema: public; Owner: postgres
420 --
421
422 CREATE FUNCTION set_curcfg(text) RETURNS void
423     AS '$libdir/tsearch2', 'set_curcfg_byname'
424     LANGUAGE c STRICT;
425
426
427 --
428 -- TOC entry 145 (OID 11524634)
429 -- Name: show_curcfg(); Type: FUNCTION; Schema: public; Owner: postgres
430 --
431
432 CREATE FUNCTION show_curcfg() RETURNS oid
433     AS '$libdir/tsearch2', 'show_curcfg'
434     LANGUAGE c STRICT;
435
436
437 --
438 -- TOC entry 146 (OID 11524696)
439 -- Name: tsvector_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
440 --
441
442 CREATE FUNCTION tsvector_in(cstring) RETURNS tsvector
443     AS '$libdir/tsearch2', 'tsvector_in'
444     LANGUAGE c STRICT;
445
446
447 --
448 -- TOC entry 147 (OID 11524697)
449 -- Name: tsvector_out(tsvector); Type: FUNCTION; Schema: public; Owner: postgres
450 --
451
452 CREATE FUNCTION tsvector_out(tsvector) RETURNS cstring
453     AS '$libdir/tsearch2', 'tsvector_out'
454     LANGUAGE c STRICT;
455
456
457 --
458 -- TOC entry 7 (OID 11524695)
459 -- Name: tsvector; Type: TYPE; Schema: public; Owner: postgres
460 --
461
462 CREATE TYPE tsvector (
463     INTERNALLENGTH = variable,
464     INPUT = tsvector_in,
465     OUTPUT = tsvector_out,
466     ALIGNMENT = int4,
467     STORAGE = extended
468 );
469
470
471 --
472 -- TOC entry 148 (OID 11524699)
473 -- Name: length(tsvector); Type: FUNCTION; Schema: public; Owner: postgres
474 --
475
476 CREATE FUNCTION length(tsvector) RETURNS integer
477     AS '$libdir/tsearch2', 'tsvector_length'
478     LANGUAGE c IMMUTABLE STRICT;
479
480
481 --
482 -- TOC entry 149 (OID 11524700)
483 -- Name: to_tsvector(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
484 --
485
486 CREATE FUNCTION to_tsvector(oid, text) RETURNS tsvector
487     AS '$libdir/tsearch2', 'to_tsvector'
488     LANGUAGE c IMMUTABLE STRICT;
489
490
491 --
492 -- TOC entry 150 (OID 11524701)
493 -- Name: to_tsvector(text, text); Type: FUNCTION; Schema: public; Owner: postgres
494 --
495
496 CREATE FUNCTION to_tsvector(text, text) RETURNS tsvector
497     AS '$libdir/tsearch2', 'to_tsvector_name'
498     LANGUAGE c IMMUTABLE STRICT;
499
500
501 --
502 -- TOC entry 151 (OID 11524702)
503 -- Name: to_tsvector(text); Type: FUNCTION; Schema: public; Owner: postgres
504 --
505
506 CREATE FUNCTION to_tsvector(text) RETURNS tsvector
507     AS '$libdir/tsearch2', 'to_tsvector_current'
508     LANGUAGE c IMMUTABLE STRICT;
509
510
511 --
512 -- TOC entry 152 (OID 11524703)
513 -- Name: strip(tsvector); Type: FUNCTION; Schema: public; Owner: postgres
514 --
515
516 CREATE FUNCTION strip(tsvector) RETURNS tsvector
517     AS '$libdir/tsearch2', 'strip'
518     LANGUAGE c IMMUTABLE STRICT;
519
520
521 --
522 -- TOC entry 153 (OID 11524704)
523 -- Name: setweight(tsvector, "char"); Type: FUNCTION; Schema: public; Owner: postgres
524 --
525
526 CREATE FUNCTION setweight(tsvector, "char") RETURNS tsvector
527     AS '$libdir/tsearch2', 'setweight'
528     LANGUAGE c IMMUTABLE STRICT;
529
530
531 --
532 -- TOC entry 154 (OID 11524705)
533 -- Name: concat(tsvector, tsvector); Type: FUNCTION; Schema: public; Owner: postgres
534 --
535
536 CREATE FUNCTION concat(tsvector, tsvector) RETURNS tsvector
537     AS '$libdir/tsearch2', 'concat'
538     LANGUAGE c IMMUTABLE STRICT;
539
540
541 --
542 -- TOC entry 194 (OID 11524706)
543 -- Name: ||; Type: OPERATOR; Schema: public; Owner: postgres
544 --
545
546 CREATE OPERATOR || (
547     PROCEDURE = concat,
548     LEFTARG = tsvector,
549     RIGHTARG = tsvector
550 );
551
552
553 --
554 -- TOC entry 155 (OID 11524708)
555 -- Name: tsquery_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
556 --
557
558 CREATE FUNCTION tsquery_in(cstring) RETURNS tsquery
559     AS '$libdir/tsearch2', 'tsquery_in'
560     LANGUAGE c STRICT;
561
562
563 --
564 -- TOC entry 156 (OID 11524709)
565 -- Name: tsquery_out(tsquery); Type: FUNCTION; Schema: public; Owner: postgres
566 --
567
568 CREATE FUNCTION tsquery_out(tsquery) RETURNS cstring
569     AS '$libdir/tsearch2', 'tsquery_out'
570     LANGUAGE c STRICT;
571
572
573 --
574 -- TOC entry 8 (OID 11524707)
575 -- Name: tsquery; Type: TYPE; Schema: public; Owner: postgres
576 --
577
578 CREATE TYPE tsquery (
579     INTERNALLENGTH = variable,
580     INPUT = tsquery_in,
581     OUTPUT = tsquery_out,
582     ALIGNMENT = int4,
583     STORAGE = plain
584 );
585
586
587 --
588 -- TOC entry 157 (OID 11524711)
589 -- Name: querytree(tsquery); Type: FUNCTION; Schema: public; Owner: postgres
590 --
591
592 CREATE FUNCTION querytree(tsquery) RETURNS text
593     AS '$libdir/tsearch2', 'tsquerytree'
594     LANGUAGE c STRICT;
595
596
597 --
598 -- TOC entry 158 (OID 11524712)
599 -- Name: to_tsquery(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
600 --
601
602 CREATE FUNCTION to_tsquery(oid, text) RETURNS tsquery
603     AS '$libdir/tsearch2', 'to_tsquery'
604     LANGUAGE c IMMUTABLE STRICT;
605
606
607 --
608 -- TOC entry 159 (OID 11524713)
609 -- Name: to_tsquery(text, text); Type: FUNCTION; Schema: public; Owner: postgres
610 --
611
612 CREATE FUNCTION to_tsquery(text, text) RETURNS tsquery
613     AS '$libdir/tsearch2', 'to_tsquery_name'
614     LANGUAGE c IMMUTABLE STRICT;
615
616
617 --
618 -- TOC entry 160 (OID 11524714)
619 -- Name: to_tsquery(text); Type: FUNCTION; Schema: public; Owner: postgres
620 --
621
622 CREATE FUNCTION to_tsquery(text) RETURNS tsquery
623     AS '$libdir/tsearch2', 'to_tsquery_current'
624     LANGUAGE c IMMUTABLE STRICT;
625
626
627 --
628 -- TOC entry 161 (OID 11524715)
629 -- Name: exectsq(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
630 --
631
632 CREATE FUNCTION exectsq(tsvector, tsquery) RETURNS boolean
633     AS '$libdir/tsearch2', 'exectsq'
634     LANGUAGE c IMMUTABLE STRICT;
635
636
637 --
638 -- TOC entry 163 (OID 11524716)
639 -- Name: rexectsq(tsquery, tsvector); Type: FUNCTION; Schema: public; Owner: postgres
640 --
641
642 CREATE FUNCTION rexectsq(tsquery, tsvector) RETURNS boolean
643     AS '$libdir/tsearch2', 'rexectsq'
644     LANGUAGE c IMMUTABLE STRICT;
645
646
647 --
648 -- TOC entry 196 (OID 11524717)
649 -- Name: @@; Type: OPERATOR; Schema: public; Owner: postgres
650 --
651
652 CREATE OPERATOR @@ (
653     PROCEDURE = rexectsq,
654     LEFTARG = tsquery,
655     RIGHTARG = tsvector,
656     COMMUTATOR = @@,
657     RESTRICT = contsel,
658     JOIN = contjoinsel
659 );
660
661
662 --
663 -- TOC entry 195 (OID 11524718)
664 -- Name: @@; Type: OPERATOR; Schema: public; Owner: postgres
665 --
666
667 CREATE OPERATOR @@ (
668     PROCEDURE = exectsq,
669     LEFTARG = tsvector,
670     RIGHTARG = tsquery,
671     COMMUTATOR = @@,
672     RESTRICT = contsel,
673     JOIN = contjoinsel
674 );
675
676
677 --
678 -- TOC entry 165 (OID 11524719)
679 -- Name: tsearch2(); Type: FUNCTION; Schema: public; Owner: postgres
680 --
681
682 CREATE FUNCTION tsearch2() RETURNS "trigger"
683     AS '$libdir/tsearch2', 'tsearch2'
684     LANGUAGE c;
685
686
687 --
688 -- TOC entry 166 (OID 11524720)
689 -- Name: rank(real[], tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
690 --
691
692 CREATE FUNCTION rank(real[], tsvector, tsquery) RETURNS real
693     AS '$libdir/tsearch2', 'rank'
694     LANGUAGE c IMMUTABLE STRICT;
695
696
697 --
698 -- TOC entry 167 (OID 11524721)
699 -- Name: rank(real[], tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
700 --
701
702 CREATE FUNCTION rank(real[], tsvector, tsquery, integer) RETURNS real
703     AS '$libdir/tsearch2', 'rank'
704     LANGUAGE c IMMUTABLE STRICT;
705
706
707 --
708 -- TOC entry 168 (OID 11524722)
709 -- Name: rank(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
710 --
711
712 CREATE FUNCTION rank(tsvector, tsquery) RETURNS real
713     AS '$libdir/tsearch2', 'rank_def'
714     LANGUAGE c IMMUTABLE STRICT;
715
716
717 --
718 -- TOC entry 169 (OID 11524723)
719 -- Name: rank(tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
720 --
721
722 CREATE FUNCTION rank(tsvector, tsquery, integer) RETURNS real
723     AS '$libdir/tsearch2', 'rank_def'
724     LANGUAGE c IMMUTABLE STRICT;
725
726
727 --
728 -- TOC entry 170 (OID 11524724)
729 -- Name: rank_cd(integer, tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
730 --
731
732 CREATE FUNCTION rank_cd(integer, tsvector, tsquery) RETURNS real
733     AS '$libdir/tsearch2', 'rank_cd'
734     LANGUAGE c IMMUTABLE STRICT;
735
736
737 --
738 -- TOC entry 171 (OID 11524725)
739 -- Name: rank_cd(integer, tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
740 --
741
742 CREATE FUNCTION rank_cd(integer, tsvector, tsquery, integer) RETURNS real
743     AS '$libdir/tsearch2', 'rank_cd'
744     LANGUAGE c IMMUTABLE STRICT;
745
746
747 --
748 -- TOC entry 172 (OID 11524726)
749 -- Name: rank_cd(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
750 --
751
752 CREATE FUNCTION rank_cd(tsvector, tsquery) RETURNS real
753     AS '$libdir/tsearch2', 'rank_cd_def'
754     LANGUAGE c IMMUTABLE STRICT;
755
756
757 --
758 -- TOC entry 173 (OID 11524727)
759 -- Name: rank_cd(tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
760 --
761
762 CREATE FUNCTION rank_cd(tsvector, tsquery, integer) RETURNS real
763     AS '$libdir/tsearch2', 'rank_cd_def'
764     LANGUAGE c IMMUTABLE STRICT;
765
766
767 --
768 -- TOC entry 174 (OID 11524728)
769 -- Name: headline(oid, text, tsquery, text); Type: FUNCTION; Schema: public; Owner: postgres
770 --
771
772 CREATE FUNCTION headline(oid, text, tsquery, text) RETURNS text
773     AS '$libdir/tsearch2', 'headline'
774     LANGUAGE c IMMUTABLE STRICT;
775
776
777 --
778 -- TOC entry 175 (OID 11524729)
779 -- Name: headline(oid, text, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
780 --
781
782 CREATE FUNCTION headline(oid, text, tsquery) RETURNS text
783     AS '$libdir/tsearch2', 'headline'
784     LANGUAGE c IMMUTABLE STRICT;
785
786
787 --
788 -- TOC entry 176 (OID 11524730)
789 -- Name: headline(text, text, tsquery, text); Type: FUNCTION; Schema: public; Owner: postgres
790 --
791
792 CREATE FUNCTION headline(text, text, tsquery, text) RETURNS text
793     AS '$libdir/tsearch2', 'headline_byname'
794     LANGUAGE c IMMUTABLE STRICT;
795
796
797 --
798 -- TOC entry 177 (OID 11524731)
799 -- Name: headline(text, text, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
800 --
801
802 CREATE FUNCTION headline(text, text, tsquery) RETURNS text
803     AS '$libdir/tsearch2', 'headline_byname'
804     LANGUAGE c IMMUTABLE STRICT;
805
806
807 --
808 -- TOC entry 178 (OID 11524732)
809 -- Name: headline(text, tsquery, text); Type: FUNCTION; Schema: public; Owner: postgres
810 --
811
812 CREATE FUNCTION headline(text, tsquery, text) RETURNS text
813     AS '$libdir/tsearch2', 'headline_current'
814     LANGUAGE c IMMUTABLE STRICT;
815
816
817 --
818 -- TOC entry 179 (OID 11524733)
819 -- Name: headline(text, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
820 --
821
822 CREATE FUNCTION headline(text, tsquery) RETURNS text
823     AS '$libdir/tsearch2', 'headline_current'
824     LANGUAGE c IMMUTABLE STRICT;
825
826
827 --
828 -- TOC entry 180 (OID 11524735)
829 -- Name: gtsvector_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
830 --
831
832 CREATE FUNCTION gtsvector_in(cstring) RETURNS gtsvector
833     AS '$libdir/tsearch2', 'gtsvector_in'
834     LANGUAGE c STRICT;
835
836
837 --
838 -- TOC entry 181 (OID 11524736)
839 -- Name: gtsvector_out(gtsvector); Type: FUNCTION; Schema: public; Owner: postgres
840 --
841
842 CREATE FUNCTION gtsvector_out(gtsvector) RETURNS cstring
843     AS '$libdir/tsearch2', 'gtsvector_out'
844     LANGUAGE c STRICT;
845
846
847 --
848 -- TOC entry 9 (OID 11524734)
849 -- Name: gtsvector; Type: TYPE; Schema: public; Owner: postgres
850 --
851
852 CREATE TYPE gtsvector (
853     INTERNALLENGTH = variable,
854     INPUT = gtsvector_in,
855     OUTPUT = gtsvector_out,
856     ALIGNMENT = int4,
857     STORAGE = plain
858 );
859
860
861 --
862 -- TOC entry 182 (OID 11524738)
863 -- Name: gtsvector_consistent(gtsvector, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
864 --
865
866 CREATE FUNCTION gtsvector_consistent(gtsvector, internal, integer) RETURNS boolean
867     AS '$libdir/tsearch2', 'gtsvector_consistent'
868     LANGUAGE c;
869
870
871 --
872 -- TOC entry 183 (OID 11524739)
873 -- Name: gtsvector_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
874 --
875
876 CREATE FUNCTION gtsvector_compress(internal) RETURNS internal
877     AS '$libdir/tsearch2', 'gtsvector_compress'
878     LANGUAGE c;
879
880
881 --
882 -- TOC entry 184 (OID 11524740)
883 -- Name: gtsvector_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
884 --
885
886 CREATE FUNCTION gtsvector_decompress(internal) RETURNS internal
887     AS '$libdir/tsearch2', 'gtsvector_decompress'
888     LANGUAGE c;
889
890
891 --
892 -- TOC entry 185 (OID 11524741)
893 -- Name: gtsvector_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
894 --
895
896 CREATE FUNCTION gtsvector_penalty(internal, internal, internal) RETURNS internal
897     AS '$libdir/tsearch2', 'gtsvector_penalty'
898     LANGUAGE c STRICT;
899
900
901 --
902 -- TOC entry 186 (OID 11524742)
903 -- Name: gtsvector_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
904 --
905
906 CREATE FUNCTION gtsvector_picksplit(internal, internal) RETURNS internal
907     AS '$libdir/tsearch2', 'gtsvector_picksplit'
908     LANGUAGE c;
909
910
911 --
912 -- TOC entry 187 (OID 11524743)
913 -- Name: gtsvector_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
914 --
915
916 CREATE FUNCTION gtsvector_union(bytea, internal) RETURNS integer[]
917     AS '$libdir/tsearch2', 'gtsvector_union'
918     LANGUAGE c;
919
920
921 --
922 -- TOC entry 188 (OID 11524744)
923 -- Name: gtsvector_same(gtsvector, gtsvector, internal); Type: FUNCTION; Schema: public; Owner: postgres
924 --
925
926 CREATE FUNCTION gtsvector_same(gtsvector, gtsvector, internal) RETURNS internal
927     AS '$libdir/tsearch2', 'gtsvector_same'
928     LANGUAGE c;
929
930
931 --
932 -- TOC entry 197 (OID 11524745)
933 -- Name: gist_tsvector_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
934 --
935
936 CREATE OPERATOR CLASS gist_tsvector_ops
937     DEFAULT FOR TYPE tsvector USING gist AS
938     STORAGE gtsvector ,
939     OPERATOR 1 @@(tsvector,tsquery) RECHECK ,
940     FUNCTION 1 gtsvector_consistent(gtsvector,internal,integer) ,
941     FUNCTION 2 gtsvector_union(bytea,internal) ,
942     FUNCTION 3 gtsvector_compress(internal) ,
943     FUNCTION 4 gtsvector_decompress(internal) ,
944     FUNCTION 5 gtsvector_penalty(internal,internal,internal) ,
945     FUNCTION 6 gtsvector_picksplit(internal,internal) ,
946     FUNCTION 7 gtsvector_same(gtsvector,gtsvector,internal);
947
948
949 --
950 -- TOC entry 10 (OID 11524747)
951 -- Name: statinfo; Type: TYPE; Schema: public; Owner: postgres
952 --
953
954 CREATE TYPE statinfo AS (
955         word text,
956         ndoc integer,
957         nentry integer
958 );
959
960
961 --
962 -- TOC entry 189 (OID 11524748)
963 -- Name: stat(text); Type: FUNCTION; Schema: public; Owner: postgres
964 --
965
966 CREATE FUNCTION stat(text) RETURNS SETOF statinfo
967     AS '$libdir/tsearch2', 'ts_stat'
968     LANGUAGE c STRICT;
969
970
971 --
972 -- TOC entry 190 (OID 11524749)
973 -- Name: reset_tsearch(); Type: FUNCTION; Schema: public; Owner: postgres
974 --
975
976 CREATE FUNCTION reset_tsearch() RETURNS void
977     AS '$libdir/tsearch2', 'reset_tsearch'
978     LANGUAGE c STRICT;
979
980
981 --
982 -- TOC entry 191 (OID 11524750)
983 -- Name: get_covers(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
984 --
985
986 CREATE FUNCTION get_covers(tsvector, tsquery) RETURNS text
987     AS '$libdir/tsearch2', 'get_covers'
988     LANGUAGE c STRICT;
989
990
991 --
992 -- TOC entry 11 (OID 11524752)
993 -- Name: tsdebug; Type: TYPE; Schema: public; Owner: postgres
994 --
995
996 CREATE TYPE tsdebug AS (
997         ts_name text,
998         tok_type text,
999         description text,
1000         token text,
1001         dict_name text[],
1002         tsvector tsvector
1003 );
1004
1005
1006 --
1007 -- TOC entry 192 (OID 11524753)
1008 -- Name: _get_parser_from_curcfg(); Type: FUNCTION; Schema: public; Owner: postgres
1009 --
1010
1011 CREATE FUNCTION _get_parser_from_curcfg() RETURNS text
1012     AS ' select prs_name from pg_ts_cfg where oid = show_curcfg() '
1013     LANGUAGE sql IMMUTABLE STRICT;
1014
1015
1016 --
1017 -- TOC entry 193 (OID 11524754)
1018 -- Name: ts_debug(text); Type: FUNCTION; Schema: public; Owner: postgres
1019 --
1020
1021 CREATE FUNCTION ts_debug(text) RETURNS SETOF tsdebug
1022     AS '
1023 select 
1024         m.ts_name,
1025         t.alias as tok_type,
1026         t.descr as description,
1027         p.token,
1028         m.dict_name,
1029         strip(to_tsvector(p.token)) as tsvector
1030 from
1031         parse( _get_parser_from_curcfg(), $1 ) as p,
1032         token_type() as t,
1033         pg_ts_cfgmap as m,
1034         pg_ts_cfg as c
1035 where
1036         t.tokid=p.tokid and
1037         t.alias = m.tok_alias and 
1038         m.ts_name=c.ts_name and 
1039         c.oid=show_curcfg() 
1040 '
1041     LANGUAGE sql STRICT;
1042
1043
1044 --
1045 -- TOC entry 20 (OID 11524757)
1046 -- Name: pages; Type: TABLE; Schema: public; Owner: rich
1047 --
1048
1049 CREATE TABLE pages (
1050     id serial NOT NULL,
1051     url text,
1052     url_deleted text,
1053     title text NOT NULL,
1054     description text NOT NULL,
1055     creation_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
1056     last_modified_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
1057     hostid integer NOT NULL,
1058     logged_ip text,
1059     redirect text,
1060     css text,
1061     logged_user integer,
1062     title_description_fti tsvector NOT NULL
1063 );
1064
1065
1066 --
1067 -- TOC entry 21 (OID 11524757)
1068 -- Name: pages; Type: ACL; Schema: public; Owner: rich
1069 --
1070
1071 REVOKE ALL ON TABLE pages FROM PUBLIC;
1072 GRANT ALL ON TABLE pages TO "www-data";
1073
1074
1075 --
1076 -- TOC entry 65 (OID 11524757)
1077 -- Name: pages_id_seq; Type: ACL; Schema: public; Owner: rich
1078 --
1079
1080 REVOKE ALL ON TABLE pages_id_seq FROM PUBLIC;
1081 GRANT ALL ON TABLE pages_id_seq TO "www-data";
1082
1083
1084 --
1085 -- TOC entry 22 (OID 11524767)
1086 -- Name: contents; Type: TABLE; Schema: public; Owner: rich
1087 --
1088
1089 CREATE TABLE contents (
1090     id serial NOT NULL,
1091     pageid integer NOT NULL,
1092     ordering integer NOT NULL,
1093     sectionname text,
1094     content text NOT NULL,
1095     divname text,
1096     content_fti tsvector NOT NULL
1097 );
1098
1099
1100 --
1101 -- TOC entry 23 (OID 11524767)
1102 -- Name: contents; Type: ACL; Schema: public; Owner: rich
1103 --
1104
1105 REVOKE ALL ON TABLE contents FROM PUBLIC;
1106 GRANT ALL ON TABLE contents TO "www-data";
1107
1108
1109 --
1110 -- TOC entry 66 (OID 11524767)
1111 -- Name: contents_id_seq; Type: ACL; Schema: public; Owner: rich
1112 --
1113
1114 REVOKE ALL ON TABLE contents_id_seq FROM PUBLIC;
1115 GRANT ALL ON TABLE contents_id_seq TO "www-data";
1116
1117
1118 --
1119 -- TOC entry 24 (OID 11524775)
1120 -- Name: hosts; Type: TABLE; Schema: public; Owner: rich
1121 --
1122
1123 CREATE TABLE hosts (
1124     id serial NOT NULL,
1125     canonical_hostname text NOT NULL,
1126     css text,
1127     edit_anon boolean DEFAULT true NOT NULL,
1128     create_account_anon boolean DEFAULT true NOT NULL,
1129     theme_css text,
1130     feedback_email text,
1131     mailing_list boolean DEFAULT false NOT NULL,
1132     is_template boolean DEFAULT false NOT NULL,
1133     search_box boolean DEFAULT true NOT NULL,
1134     view_anon boolean DEFAULT true NOT NULL,
1135     navigation boolean DEFAULT false NOT NULL,
1136     powered_by integer,
1137     brand text,
1138     brand_tagline text,
1139     brand_description text,
1140     pagebug text
1141 );
1142
1143
1144 --
1145 -- TOC entry 25 (OID 11524775)
1146 -- Name: hosts; Type: ACL; Schema: public; Owner: rich
1147 --
1148
1149 REVOKE ALL ON TABLE hosts FROM PUBLIC;
1150 GRANT ALL ON TABLE hosts TO "www-data";
1151
1152
1153 --
1154 -- TOC entry 67 (OID 11524775)
1155 -- Name: hosts_id_seq; Type: ACL; Schema: public; Owner: rich
1156 --
1157
1158 REVOKE ALL ON TABLE hosts_id_seq FROM PUBLIC;
1159 GRANT ALL ON TABLE hosts_id_seq TO "www-data";
1160
1161
1162 --
1163 -- TOC entry 26 (OID 11524788)
1164 -- Name: hostnames; Type: TABLE; Schema: public; Owner: rich
1165 --
1166
1167 CREATE TABLE hostnames (
1168     hostid integer NOT NULL,
1169     name text NOT NULL
1170 );
1171
1172
1173 --
1174 -- TOC entry 27 (OID 11524788)
1175 -- Name: hostnames; Type: ACL; Schema: public; Owner: rich
1176 --
1177
1178 REVOKE ALL ON TABLE hostnames FROM PUBLIC;
1179 GRANT ALL ON TABLE hostnames TO "www-data";
1180
1181
1182 --
1183 -- TOC entry 28 (OID 11524795)
1184 -- Name: images; Type: TABLE; Schema: public; Owner: rich
1185 --
1186
1187 CREATE TABLE images (
1188     id serial NOT NULL,
1189     hostid integer NOT NULL,
1190     name text,
1191     name_deleted text,
1192     image bytea NOT NULL,
1193     width integer NOT NULL,
1194     height integer NOT NULL,
1195     alt text NOT NULL,
1196     title text,
1197     longdesc text,
1198     "class" text,
1199     mime_type text NOT NULL,
1200     thumbnail bytea,
1201     tn_width integer,
1202     tn_height integer,
1203     tn_mime_type text,
1204     upload_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
1205 );
1206
1207
1208 --
1209 -- TOC entry 29 (OID 11524795)
1210 -- Name: images; Type: ACL; Schema: public; Owner: rich
1211 --
1212
1213 REVOKE ALL ON TABLE images FROM PUBLIC;
1214 GRANT ALL ON TABLE images TO "www-data";
1215
1216
1217 --
1218 -- TOC entry 68 (OID 11524795)
1219 -- Name: images_id_seq; Type: ACL; Schema: public; Owner: rich
1220 --
1221
1222 REVOKE ALL ON TABLE images_id_seq FROM PUBLIC;
1223 GRANT ALL ON TABLE images_id_seq TO "www-data";
1224
1225
1226 --
1227 -- TOC entry 30 (OID 11524804)
1228 -- Name: files; Type: TABLE; Schema: public; Owner: rich
1229 --
1230
1231 CREATE TABLE files (
1232     id serial NOT NULL,
1233     hostid integer NOT NULL,
1234     name text,
1235     name_deleted text,
1236     content bytea NOT NULL,
1237     title text,
1238     mime_type text NOT NULL,
1239     upload_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
1240 );
1241
1242
1243 --
1244 -- TOC entry 31 (OID 11524804)
1245 -- Name: files; Type: ACL; Schema: public; Owner: rich
1246 --
1247
1248 REVOKE ALL ON TABLE files FROM PUBLIC;
1249 GRANT ALL ON TABLE files TO "www-data";
1250
1251
1252 --
1253 -- TOC entry 69 (OID 11524804)
1254 -- Name: files_id_seq; Type: ACL; Schema: public; Owner: rich
1255 --
1256
1257 REVOKE ALL ON TABLE files_id_seq FROM PUBLIC;
1258 GRANT ALL ON TABLE files_id_seq TO "www-data";
1259
1260
1261 --
1262 -- TOC entry 32 (OID 11524813)
1263 -- Name: users; Type: TABLE; Schema: public; Owner: rich
1264 --
1265
1266 CREATE TABLE users (
1267     id serial NOT NULL,
1268     hostid integer NOT NULL,
1269     name text NOT NULL,
1270     "password" text NOT NULL,
1271     email text,
1272     registration_date date DEFAULT ('now'::text)::date NOT NULL,
1273     can_edit boolean DEFAULT true NOT NULL,
1274     can_manage_users boolean DEFAULT false NOT NULL,
1275     can_manage_contacts boolean DEFAULT false NOT NULL,
1276     can_manage_site boolean DEFAULT false NOT NULL,
1277     can_edit_global_css boolean DEFAULT false NOT NULL,
1278     force_password_change boolean DEFAULT false NOT NULL,
1279     can_import_mail boolean DEFAULT false NOT NULL,
1280     email_notify boolean DEFAULT true NOT NULL,
1281     invite text
1282 );
1283
1284
1285 --
1286 -- TOC entry 33 (OID 11524813)
1287 -- Name: users; Type: ACL; Schema: public; Owner: rich
1288 --
1289
1290 REVOKE ALL ON TABLE users FROM PUBLIC;
1291 GRANT ALL ON TABLE users TO "www-data";
1292
1293
1294 --
1295 -- TOC entry 70 (OID 11524813)
1296 -- Name: users_id_seq; Type: ACL; Schema: public; Owner: rich
1297 --
1298
1299 REVOKE ALL ON TABLE users_id_seq FROM PUBLIC;
1300 GRANT ALL ON TABLE users_id_seq TO "www-data";
1301
1302
1303 --
1304 -- TOC entry 34 (OID 11524828)
1305 -- Name: usercookies; Type: TABLE; Schema: public; Owner: rich
1306 --
1307
1308 CREATE TABLE usercookies (
1309     userid integer NOT NULL,
1310     cookie text NOT NULL
1311 );
1312
1313
1314 --
1315 -- TOC entry 35 (OID 11524828)
1316 -- Name: usercookies; Type: ACL; Schema: public; Owner: rich
1317 --
1318
1319 REVOKE ALL ON TABLE usercookies FROM PUBLIC;
1320 GRANT ALL ON TABLE usercookies TO "www-data";
1321
1322
1323 --
1324 -- TOC entry 36 (OID 11524833)
1325 -- Name: sitemenu; Type: TABLE; Schema: public; Owner: rich
1326 --
1327
1328 CREATE TABLE sitemenu (
1329     hostid integer NOT NULL,
1330     url text NOT NULL,
1331     label text NOT NULL,
1332     ordering integer NOT NULL
1333 );
1334
1335
1336 --
1337 -- TOC entry 37 (OID 11524833)
1338 -- Name: sitemenu; Type: ACL; Schema: public; Owner: rich
1339 --
1340
1341 REVOKE ALL ON TABLE sitemenu FROM PUBLIC;
1342 GRANT ALL ON TABLE sitemenu TO "www-data";
1343
1344
1345 --
1346 -- TOC entry 38 (OID 11524840)
1347 -- Name: contacts; Type: TABLE; Schema: public; Owner: rich
1348 --
1349
1350 CREATE TABLE contacts (
1351     id serial NOT NULL,
1352     hostid integer NOT NULL,
1353     name text NOT NULL,
1354     subject text NOT NULL
1355 );
1356
1357
1358 --
1359 -- TOC entry 39 (OID 11524840)
1360 -- Name: contacts; Type: ACL; Schema: public; Owner: rich
1361 --
1362
1363 REVOKE ALL ON TABLE contacts FROM PUBLIC;
1364 GRANT ALL ON TABLE contacts TO "www-data";
1365
1366
1367 --
1368 -- TOC entry 71 (OID 11524840)
1369 -- Name: contacts_id_seq; Type: ACL; Schema: public; Owner: rich
1370 --
1371
1372 REVOKE ALL ON TABLE contacts_id_seq FROM PUBLIC;
1373 GRANT ALL ON TABLE contacts_id_seq TO "www-data";
1374
1375
1376 --
1377 -- TOC entry 40 (OID 11524846)
1378 -- Name: contact_emails; Type: TABLE; Schema: public; Owner: rich
1379 --
1380
1381 CREATE TABLE contact_emails (
1382     contactid integer NOT NULL,
1383     email text NOT NULL
1384 );
1385
1386
1387 --
1388 -- TOC entry 41 (OID 11524846)
1389 -- Name: contact_emails; Type: ACL; Schema: public; Owner: rich
1390 --
1391
1392 REVOKE ALL ON TABLE contact_emails FROM PUBLIC;
1393 GRANT ALL ON TABLE contact_emails TO "www-data";
1394
1395
1396 --
1397 -- TOC entry 42 (OID 11524851)
1398 -- Name: themes; Type: TABLE; Schema: public; Owner: rich
1399 --
1400
1401 CREATE TABLE themes (
1402     theme_css text NOT NULL,
1403     name text NOT NULL,
1404     description text NOT NULL
1405 );
1406
1407
1408 --
1409 -- TOC entry 43 (OID 11524851)
1410 -- Name: themes; Type: ACL; Schema: public; Owner: rich
1411 --
1412
1413 REVOKE ALL ON TABLE themes FROM PUBLIC;
1414 GRANT SELECT ON TABLE themes TO "www-data";
1415
1416
1417 --
1418 -- TOC entry 44 (OID 11524856)
1419 -- Name: server_settings; Type: TABLE; Schema: public; Owner: rich
1420 --
1421
1422 CREATE TABLE server_settings (
1423     "version" integer NOT NULL,
1424     stats_page text,
1425     crash_email text
1426 );
1427
1428
1429 --
1430 -- TOC entry 46 (OID 11524856)
1431 -- Name: server_settings; Type: ACL; Schema: public; Owner: rich
1432 --
1433
1434 REVOKE ALL ON TABLE server_settings FROM PUBLIC;
1435 GRANT SELECT ON TABLE server_settings TO "www-data";
1436
1437
1438 --
1439 -- TOC entry 47 (OID 11524861)
1440 -- Name: page_emails; Type: TABLE; Schema: public; Owner: rich
1441 --
1442
1443 CREATE TABLE page_emails (
1444     hostid integer NOT NULL,
1445     url text NOT NULL,
1446     email text NOT NULL,
1447     entry_date date DEFAULT ('now'::text)::date NOT NULL,
1448     last_sent date DEFAULT ('now'::text)::date NOT NULL,
1449     pending text,
1450     opt_out text NOT NULL
1451 );
1452
1453
1454 --
1455 -- TOC entry 48 (OID 11524861)
1456 -- Name: page_emails; Type: ACL; Schema: public; Owner: rich
1457 --
1458
1459 REVOKE ALL ON TABLE page_emails FROM PUBLIC;
1460 GRANT ALL ON TABLE page_emails TO "www-data";
1461
1462
1463 --
1464 -- TOC entry 49 (OID 11524868)
1465 -- Name: mailing_lists; Type: TABLE; Schema: public; Owner: rich
1466 --
1467
1468 CREATE TABLE mailing_lists (
1469     hostid integer NOT NULL,
1470     email text NOT NULL,
1471     entry_date date DEFAULT ('now'::text)::date NOT NULL,
1472     pending text,
1473     opt_out text NOT NULL,
1474     name text NOT NULL
1475 );
1476
1477
1478 --
1479 -- TOC entry 50 (OID 11524868)
1480 -- Name: mailing_lists; Type: ACL; Schema: public; Owner: rich
1481 --
1482
1483 REVOKE ALL ON TABLE mailing_lists FROM PUBLIC;
1484 GRANT ALL ON TABLE mailing_lists TO "www-data";
1485
1486
1487 --
1488 -- TOC entry 51 (OID 11524874)
1489 -- Name: links; Type: TABLE; Schema: public; Owner: rich
1490 --
1491
1492 CREATE TABLE links (
1493     hostid integer NOT NULL,
1494     from_url text NOT NULL,
1495     to_url text NOT NULL,
1496     CONSTRAINT links_not_selfref_cn CHECK ((from_url <> to_url))
1497 );
1498
1499
1500 --
1501 -- TOC entry 52 (OID 11524874)
1502 -- Name: links; Type: ACL; Schema: public; Owner: rich
1503 --
1504
1505 REVOKE ALL ON TABLE links FROM PUBLIC;
1506 GRANT ALL ON TABLE links TO "www-data";
1507
1508
1509 --
1510 -- TOC entry 53 (OID 11524882)
1511 -- Name: templates; Type: TABLE; Schema: public; Owner: rich
1512 --
1513
1514 CREATE TABLE templates (
1515     id serial NOT NULL,
1516     title_regexp text NOT NULL,
1517     url_regexp text NOT NULL,
1518     extension text NOT NULL,
1519     ordering integer NOT NULL
1520 );
1521
1522
1523 --
1524 -- TOC entry 54 (OID 11524882)
1525 -- Name: templates; Type: ACL; Schema: public; Owner: rich
1526 --
1527
1528 REVOKE ALL ON TABLE templates FROM PUBLIC;
1529 GRANT SELECT ON TABLE templates TO "www-data";
1530
1531
1532 --
1533 -- TOC entry 72 (OID 11524882)
1534 -- Name: templates_id_seq; Type: ACL; Schema: public; Owner: rich
1535 --
1536
1537 REVOKE ALL ON TABLE templates_id_seq FROM PUBLIC;
1538
1539
1540 --
1541 -- TOC entry 55 (OID 11524888)
1542 -- Name: recently_visited; Type: TABLE; Schema: public; Owner: rich
1543 --
1544
1545 CREATE TABLE recently_visited (
1546     userid integer NOT NULL,
1547     hostid integer NOT NULL,
1548     url text NOT NULL,
1549     visit_time timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
1550 );
1551
1552
1553 --
1554 -- TOC entry 56 (OID 11524888)
1555 -- Name: recently_visited; Type: ACL; Schema: public; Owner: rich
1556 --
1557
1558 REVOKE ALL ON TABLE recently_visited FROM PUBLIC;
1559 GRANT ALL ON TABLE recently_visited TO "www-data";
1560
1561
1562 --
1563 -- TOC entry 57 (OID 11524896)
1564 -- Name: messages; Type: TABLE; Schema: public; Owner: rich
1565 --
1566
1567 CREATE TABLE messages (
1568     id serial NOT NULL,
1569     subject text NOT NULL,
1570     inet_message_id text NOT NULL,
1571     message_date timestamp with time zone NOT NULL,
1572     hostid integer NOT NULL
1573 );
1574
1575
1576 --
1577 -- TOC entry 58 (OID 11524896)
1578 -- Name: messages; Type: ACL; Schema: public; Owner: rich
1579 --
1580
1581 REVOKE ALL ON TABLE messages FROM PUBLIC;
1582 GRANT ALL ON TABLE messages TO "www-data";
1583
1584
1585 --
1586 -- TOC entry 73 (OID 11524896)
1587 -- Name: messages_id_seq; Type: ACL; Schema: public; Owner: rich
1588 --
1589
1590 REVOKE ALL ON TABLE messages_id_seq FROM PUBLIC;
1591 GRANT ALL ON TABLE messages_id_seq TO "www-data";
1592
1593
1594 --
1595 -- TOC entry 59 (OID 11524902)
1596 -- Name: msg_references; Type: TABLE; Schema: public; Owner: rich
1597 --
1598
1599 CREATE TABLE msg_references (
1600     message_id integer NOT NULL,
1601     inet_message_id text NOT NULL,
1602     ordering integer NOT NULL
1603 );
1604
1605
1606 --
1607 -- TOC entry 60 (OID 11524902)
1608 -- Name: msg_references; Type: ACL; Schema: public; Owner: rich
1609 --
1610
1611 REVOKE ALL ON TABLE msg_references FROM PUBLIC;
1612 GRANT ALL ON TABLE msg_references TO "www-data";
1613
1614
1615 --
1616 -- TOC entry 61 (OID 11524909)
1617 -- Name: powered_by; Type: TABLE; Schema: public; Owner: rich
1618 --
1619
1620 CREATE TABLE powered_by (
1621     id serial NOT NULL,
1622     name text NOT NULL,
1623     url text NOT NULL
1624 );
1625
1626
1627 --
1628 -- TOC entry 62 (OID 11524909)
1629 -- Name: powered_by; Type: ACL; Schema: public; Owner: rich
1630 --
1631
1632 REVOKE ALL ON TABLE powered_by FROM PUBLIC;
1633 GRANT SELECT ON TABLE powered_by TO "www-data";
1634
1635
1636 --
1637 -- TOC entry 63 (OID 11524915)
1638 -- Name: pending_email_changes; Type: TABLE; Schema: public; Owner: rich
1639 --
1640
1641 CREATE TABLE pending_email_changes (
1642     "key" text NOT NULL,
1643     change_date date DEFAULT ('now'::text)::date NOT NULL,
1644     userid integer NOT NULL,
1645     email text NOT NULL
1646 );
1647
1648
1649 --
1650 -- TOC entry 64 (OID 11524915)
1651 -- Name: pending_email_changes; Type: ACL; Schema: public; Owner: rich
1652 --
1653
1654 REVOKE ALL ON TABLE pending_email_changes FROM PUBLIC;
1655 GRANT ALL ON TABLE pending_email_changes TO "www-data";
1656
1657
1658 --
1659 -- TOC entry 88 (OID 11576669)
1660 -- Name: hostnames_hostid_name_uq; Type: INDEX; Schema: public; Owner: rich
1661 --
1662
1663 CREATE UNIQUE INDEX hostnames_hostid_name_uq ON hostnames USING btree (hostid, name);
1664
1665
1666 --
1667 -- TOC entry 83 (OID 11576670)
1668 -- Name: pages_url_uq; Type: INDEX; Schema: public; Owner: rich
1669 --
1670
1671 CREATE UNIQUE INDEX pages_url_uq ON pages USING btree (hostid, url);
1672
1673
1674 --
1675 -- TOC entry 90 (OID 11576671)
1676 -- Name: images_name_uq; Type: INDEX; Schema: public; Owner: rich
1677 --
1678
1679 CREATE UNIQUE INDEX images_name_uq ON images USING btree (hostid, name);
1680
1681
1682 --
1683 -- TOC entry 92 (OID 11576672)
1684 -- Name: files_name_uq; Type: INDEX; Schema: public; Owner: rich
1685 --
1686
1687 CREATE UNIQUE INDEX files_name_uq ON files USING btree (hostid, name);
1688
1689
1690 --
1691 -- TOC entry 95 (OID 11576673)
1692 -- Name: users_name_uq; Type: INDEX; Schema: public; Owner: rich
1693 --
1694
1695 CREATE UNIQUE INDEX users_name_uq ON users USING btree (hostid, name);
1696
1697
1698 --
1699 -- TOC entry 94 (OID 11576674)
1700 -- Name: users_id_uq; Type: INDEX; Schema: public; Owner: rich
1701 --
1702
1703 CREATE UNIQUE INDEX users_id_uq ON users USING btree (hostid, id);
1704
1705
1706 --
1707 -- TOC entry 98 (OID 11576675)
1708 -- Name: sitemenu_ordering_uq; Type: INDEX; Schema: public; Owner: rich
1709 --
1710
1711 CREATE UNIQUE INDEX sitemenu_ordering_uq ON sitemenu USING btree (hostid, ordering);
1712
1713
1714 --
1715 -- TOC entry 99 (OID 11576676)
1716 -- Name: sitemenu_url_uq; Type: INDEX; Schema: public; Owner: rich
1717 --
1718
1719 CREATE UNIQUE INDEX sitemenu_url_uq ON sitemenu USING btree (hostid, url);
1720
1721
1722 --
1723 -- TOC entry 102 (OID 11576677)
1724 -- Name: contact_emails_uq; Type: INDEX; Schema: public; Owner: rich
1725 --
1726
1727 CREATE UNIQUE INDEX contact_emails_uq ON contact_emails USING btree (contactid, email);
1728
1729
1730 --
1731 -- TOC entry 103 (OID 11576678)
1732 -- Name: themes_theme_css_uq; Type: INDEX; Schema: public; Owner: rich
1733 --
1734
1735 CREATE UNIQUE INDEX themes_theme_css_uq ON themes USING btree (theme_css);
1736
1737
1738 --
1739 -- TOC entry 104 (OID 11576679)
1740 -- Name: page_emails_email_uq; Type: INDEX; Schema: public; Owner: rich
1741 --
1742
1743 CREATE UNIQUE INDEX page_emails_email_uq ON page_emails USING btree (hostid, url, email);
1744
1745
1746 --
1747 -- TOC entry 105 (OID 11576680)
1748 -- Name: mailing_lists_email_uq; Type: INDEX; Schema: public; Owner: rich
1749 --
1750
1751 CREATE UNIQUE INDEX mailing_lists_email_uq ON mailing_lists USING btree (hostid, email);
1752
1753
1754 --
1755 -- TOC entry 100 (OID 11576681)
1756 -- Name: contacts_name_uq; Type: INDEX; Schema: public; Owner: rich
1757 --
1758
1759 CREATE UNIQUE INDEX contacts_name_uq ON contacts USING btree (hostid, name);
1760
1761
1762 --
1763 -- TOC entry 106 (OID 11576682)
1764 -- Name: links_uq; Type: INDEX; Schema: public; Owner: rich
1765 --
1766
1767 CREATE UNIQUE INDEX links_uq ON links USING btree (hostid, from_url, to_url);
1768
1769
1770 --
1771 -- TOC entry 107 (OID 11576683)
1772 -- Name: templates_ext_ord_uq; Type: INDEX; Schema: public; Owner: rich
1773 --
1774
1775 CREATE UNIQUE INDEX templates_ext_ord_uq ON templates USING btree (extension, ordering);
1776
1777
1778 --
1779 -- TOC entry 109 (OID 11576684)
1780 -- Name: templates_title_uq; Type: INDEX; Schema: public; Owner: rich
1781 --
1782
1783 CREATE UNIQUE INDEX templates_title_uq ON templates USING btree (title_regexp);
1784
1785
1786 --
1787 -- TOC entry 110 (OID 11576685)
1788 -- Name: templates_url_uq; Type: INDEX; Schema: public; Owner: rich
1789 --
1790
1791 CREATE UNIQUE INDEX templates_url_uq ON templates USING btree (url_regexp);
1792
1793
1794 --
1795 -- TOC entry 111 (OID 11576686)
1796 -- Name: recently_visited_uq; Type: INDEX; Schema: public; Owner: rich
1797 --
1798
1799 CREATE UNIQUE INDEX recently_visited_uq ON recently_visited USING btree (userid, hostid, url);
1800
1801
1802 --
1803 -- TOC entry 112 (OID 11576687)
1804 -- Name: messages_inet_message_id_uq; Type: INDEX; Schema: public; Owner: rich
1805 --
1806
1807 CREATE UNIQUE INDEX messages_inet_message_id_uq ON messages USING btree (hostid, inet_message_id);
1808
1809
1810 --
1811 -- TOC entry 82 (OID 11576688)
1812 -- Name: pages_url_ix; Type: INDEX; Schema: public; Owner: rich
1813 --
1814
1815 CREATE INDEX pages_url_ix ON pages USING btree (url);
1816
1817
1818 --
1819 -- TOC entry 81 (OID 11576689)
1820 -- Name: pages_redirect_ix; Type: INDEX; Schema: public; Owner: rich
1821 --
1822
1823 CREATE INDEX pages_redirect_ix ON pages USING btree (redirect);
1824
1825
1826 --
1827 -- TOC entry 78 (OID 11576690)
1828 -- Name: pages_fti_idx; Type: INDEX; Schema: public; Owner: rich
1829 --
1830
1831 CREATE INDEX pages_fti_idx ON pages USING gist (title_description_fti);
1832
1833
1834 --
1835 -- TOC entry 84 (OID 11576691)
1836 -- Name: contents_fti_idx; Type: INDEX; Schema: public; Owner: rich
1837 --
1838
1839 CREATE INDEX contents_fti_idx ON contents USING gist (content_fti);
1840
1841
1842 --
1843 -- TOC entry 85 (OID 11576692)
1844 -- Name: contents_pageid_idx; Type: INDEX; Schema: public; Owner: rich
1845 --
1846
1847 CREATE INDEX contents_pageid_idx ON contents USING btree (pageid);
1848
1849
1850 --
1851 -- TOC entry 89 (OID 11576693)
1852 -- Name: hostnames_name_uq; Type: INDEX; Schema: public; Owner: rich
1853 --
1854
1855 CREATE UNIQUE INDEX hostnames_name_uq ON hostnames USING btree (name);
1856
1857
1858 --
1859 -- TOC entry 97 (OID 11576694)
1860 -- Name: usercookies_cookie_idx; Type: INDEX; Schema: public; Owner: rich
1861 --
1862
1863 CREATE INDEX usercookies_cookie_idx ON usercookies USING btree (cookie);
1864
1865
1866 --
1867 -- TOC entry 79 (OID 11576695)
1868 -- Name: pages_lc_title; Type: INDEX; Schema: public; Owner: rich
1869 --
1870
1871 CREATE INDEX pages_lc_title ON pages USING btree (lower(title));
1872
1873
1874 --
1875 -- TOC entry 74 (OID 11524572)
1876 -- Name: pg_ts_dict_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1877 --
1878
1879 ALTER TABLE ONLY pg_ts_dict
1880     ADD CONSTRAINT pg_ts_dict_pkey PRIMARY KEY (dict_name);
1881
1882
1883 --
1884 -- TOC entry 75 (OID 11524598)
1885 -- Name: pg_ts_parser_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1886 --
1887
1888 ALTER TABLE ONLY pg_ts_parser
1889     ADD CONSTRAINT pg_ts_parser_pkey PRIMARY KEY (prs_name);
1890
1891
1892 --
1893 -- TOC entry 76 (OID 11524623)
1894 -- Name: pg_ts_cfg_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1895 --
1896
1897 ALTER TABLE ONLY pg_ts_cfg
1898     ADD CONSTRAINT pg_ts_cfg_pkey PRIMARY KEY (ts_name);
1899
1900
1901 --
1902 -- TOC entry 77 (OID 11524630)
1903 -- Name: pg_ts_cfgmap_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1904 --
1905
1906 ALTER TABLE ONLY pg_ts_cfgmap
1907     ADD CONSTRAINT pg_ts_cfgmap_pkey PRIMARY KEY (ts_name, tok_alias);
1908
1909
1910 --
1911 -- TOC entry 80 (OID 11576696)
1912 -- Name: pages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1913 --
1914
1915 ALTER TABLE ONLY pages
1916     ADD CONSTRAINT pages_pkey PRIMARY KEY (id);
1917
1918
1919 --
1920 -- TOC entry 86 (OID 11576698)
1921 -- Name: contents_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1922 --
1923
1924 ALTER TABLE ONLY contents
1925     ADD CONSTRAINT contents_pkey PRIMARY KEY (id);
1926
1927
1928 --
1929 -- TOC entry 87 (OID 11576700)
1930 -- Name: hosts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1931 --
1932
1933 ALTER TABLE ONLY hosts
1934     ADD CONSTRAINT hosts_pkey PRIMARY KEY (id);
1935
1936
1937 --
1938 -- TOC entry 91 (OID 11576702)
1939 -- Name: images_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1940 --
1941
1942 ALTER TABLE ONLY images
1943     ADD CONSTRAINT images_pkey PRIMARY KEY (id);
1944
1945
1946 --
1947 -- TOC entry 93 (OID 11576704)
1948 -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1949 --
1950
1951 ALTER TABLE ONLY files
1952     ADD CONSTRAINT files_pkey PRIMARY KEY (id);
1953
1954
1955 --
1956 -- TOC entry 96 (OID 11576706)
1957 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1958 --
1959
1960 ALTER TABLE ONLY users
1961     ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1962
1963
1964 --
1965 -- TOC entry 101 (OID 11576708)
1966 -- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1967 --
1968
1969 ALTER TABLE ONLY contacts
1970     ADD CONSTRAINT contacts_pkey PRIMARY KEY (id);
1971
1972
1973 --
1974 -- TOC entry 108 (OID 11576710)
1975 -- Name: templates_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1976 --
1977
1978 ALTER TABLE ONLY templates
1979     ADD CONSTRAINT templates_pkey PRIMARY KEY (id);
1980
1981
1982 --
1983 -- TOC entry 113 (OID 11576712)
1984 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1985 --
1986
1987 ALTER TABLE ONLY messages
1988     ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1989
1990
1991 --
1992 -- TOC entry 114 (OID 11576714)
1993 -- Name: powered_by_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1994 --
1995
1996 ALTER TABLE ONLY powered_by
1997     ADD CONSTRAINT powered_by_pkey PRIMARY KEY (id);
1998
1999
2000 --
2001 -- TOC entry 115 (OID 11576716)
2002 -- Name: pending_email_changes_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
2003 --
2004
2005 ALTER TABLE ONLY pending_email_changes
2006     ADD CONSTRAINT pending_email_changes_pkey PRIMARY KEY ("key");
2007
2008
2009 --
2010 -- TOC entry 202 (OID 11576718)
2011 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2012 --
2013
2014 ALTER TABLE ONLY contents
2015     ADD CONSTRAINT "$1" FOREIGN KEY (pageid) REFERENCES pages(id);
2016
2017
2018 --
2019 -- TOC entry 206 (OID 11576722)
2020 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2021 --
2022
2023 ALTER TABLE ONLY hostnames
2024     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2025
2026
2027 --
2028 -- TOC entry 203 (OID 11576726)
2029 -- Name: hosts_hostname_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2030 --
2031
2032 ALTER TABLE ONLY hosts
2033     ADD CONSTRAINT hosts_hostname_cn FOREIGN KEY (id, canonical_hostname) REFERENCES hostnames(hostid, name) DEFERRABLE;
2034
2035
2036 --
2037 -- TOC entry 198 (OID 11576730)
2038 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2039 --
2040
2041 ALTER TABLE ONLY pages
2042     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2043
2044
2045 --
2046 -- TOC entry 207 (OID 11576734)
2047 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2048 --
2049
2050 ALTER TABLE ONLY images
2051     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2052
2053
2054 --
2055 -- TOC entry 208 (OID 11576738)
2056 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2057 --
2058
2059 ALTER TABLE ONLY files
2060     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2061
2062
2063 --
2064 -- TOC entry 199 (OID 11576742)
2065 -- Name: pages_redirect_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2066 --
2067
2068 ALTER TABLE ONLY pages
2069     ADD CONSTRAINT pages_redirect_cn FOREIGN KEY (hostid, redirect) REFERENCES pages(hostid, url) DEFERRABLE;
2070
2071
2072 --
2073 -- TOC entry 209 (OID 11576746)
2074 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2075 --
2076
2077 ALTER TABLE ONLY users
2078     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2079
2080
2081 --
2082 -- TOC entry 210 (OID 11576750)
2083 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2084 --
2085
2086 ALTER TABLE ONLY usercookies
2087     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
2088
2089
2090 --
2091 -- TOC entry 200 (OID 11576754)
2092 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
2093 --
2094
2095 ALTER TABLE ONLY pages
2096     ADD CONSTRAINT "$2" FOREIGN KEY (logged_user) REFERENCES users(id);
2097
2098
2099 --
2100 -- TOC entry 201 (OID 11576758)
2101 -- Name: pages_user_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2102 --
2103
2104 ALTER TABLE ONLY pages
2105     ADD CONSTRAINT pages_user_cn FOREIGN KEY (hostid, logged_user) REFERENCES users(hostid, id);
2106
2107
2108 --
2109 -- TOC entry 211 (OID 11576762)
2110 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2111 --
2112
2113 ALTER TABLE ONLY sitemenu
2114     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2115
2116
2117 --
2118 -- TOC entry 212 (OID 11576766)
2119 -- Name: sitemenu_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2120 --
2121
2122 ALTER TABLE ONLY sitemenu
2123     ADD CONSTRAINT sitemenu_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
2124
2125
2126 --
2127 -- TOC entry 213 (OID 11576770)
2128 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2129 --
2130
2131 ALTER TABLE ONLY contacts
2132     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2133
2134
2135 --
2136 -- TOC entry 214 (OID 11576774)
2137 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2138 --
2139
2140 ALTER TABLE ONLY contact_emails
2141     ADD CONSTRAINT "$1" FOREIGN KEY (contactid) REFERENCES contacts(id);
2142
2143
2144 --
2145 -- TOC entry 204 (OID 11576778)
2146 -- Name: hosts_theme_css_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2147 --
2148
2149 ALTER TABLE ONLY hosts
2150     ADD CONSTRAINT hosts_theme_css_cn FOREIGN KEY (theme_css) REFERENCES themes(theme_css);
2151
2152
2153 --
2154 -- TOC entry 215 (OID 11576782)
2155 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2156 --
2157
2158 ALTER TABLE ONLY page_emails
2159     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2160
2161
2162 --
2163 -- TOC entry 216 (OID 11576786)
2164 -- Name: page_emails_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2165 --
2166
2167 ALTER TABLE ONLY page_emails
2168     ADD CONSTRAINT page_emails_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
2169
2170
2171 --
2172 -- TOC entry 217 (OID 11576790)
2173 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2174 --
2175
2176 ALTER TABLE ONLY mailing_lists
2177     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2178
2179
2180 --
2181 -- TOC entry 218 (OID 11576794)
2182 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2183 --
2184
2185 ALTER TABLE ONLY links
2186     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2187
2188
2189 --
2190 -- TOC entry 219 (OID 11576798)
2191 -- Name: links_from_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2192 --
2193
2194 ALTER TABLE ONLY links
2195     ADD CONSTRAINT links_from_cn FOREIGN KEY (hostid, from_url) REFERENCES pages(hostid, url) DEFERRABLE;
2196
2197
2198 --
2199 -- TOC entry 220 (OID 11576802)
2200 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2201 --
2202
2203 ALTER TABLE ONLY recently_visited
2204     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
2205
2206
2207 --
2208 -- TOC entry 221 (OID 11576806)
2209 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
2210 --
2211
2212 ALTER TABLE ONLY recently_visited
2213     ADD CONSTRAINT "$2" FOREIGN KEY (hostid) REFERENCES hosts(id);
2214
2215
2216 --
2217 -- TOC entry 222 (OID 11576810)
2218 -- Name: recently_visited_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2219 --
2220
2221 ALTER TABLE ONLY recently_visited
2222     ADD CONSTRAINT recently_visited_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
2223
2224
2225 --
2226 -- TOC entry 223 (OID 11576814)
2227 -- Name: recently_visited_userid_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2228 --
2229
2230 ALTER TABLE ONLY recently_visited
2231     ADD CONSTRAINT recently_visited_userid_cn FOREIGN KEY (hostid, userid) REFERENCES users(hostid, id);
2232
2233
2234 --
2235 -- TOC entry 225 (OID 11576818)
2236 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2237 --
2238
2239 ALTER TABLE ONLY msg_references
2240     ADD CONSTRAINT "$1" FOREIGN KEY (message_id) REFERENCES messages(id);
2241
2242
2243 --
2244 -- TOC entry 224 (OID 11576822)
2245 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2246 --
2247
2248 ALTER TABLE ONLY messages
2249     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2250
2251
2252 --
2253 -- TOC entry 205 (OID 11576826)
2254 -- Name: hosts_powered_by_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2255 --
2256
2257 ALTER TABLE ONLY hosts
2258     ADD CONSTRAINT hosts_powered_by_cn FOREIGN KEY (powered_by) REFERENCES powered_by(id);
2259
2260
2261 --
2262 -- TOC entry 226 (OID 11576830)
2263 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2264 --
2265
2266 ALTER TABLE ONLY pending_email_changes
2267     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
2268
2269
2270 --
2271 -- TOC entry 227 (OID 11576834)
2272 -- Name: pages_fti_tr; Type: TRIGGER; Schema: public; Owner: rich
2273 --
2274
2275 CREATE TRIGGER pages_fti_tr
2276     BEFORE INSERT OR UPDATE ON pages
2277     FOR EACH ROW
2278     EXECUTE PROCEDURE tsearch2('title_description_fti', 'title', 'description');
2279
2280
2281 --
2282 -- TOC entry 228 (OID 11576835)
2283 -- Name: contents_fti_tr; Type: TRIGGER; Schema: public; Owner: rich
2284 --
2285
2286 CREATE TRIGGER contents_fti_tr
2287     BEFORE INSERT OR UPDATE ON contents
2288     FOR EACH ROW
2289     EXECUTE PROCEDURE tsearch2('content_fti', 'sectionname', 'content');
2290
2291
2292 --
2293 -- TOC entry 3 (OID 2200)
2294 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
2295 --
2296
2297 COMMENT ON SCHEMA public IS 'Standard public namespace';
2298
2299
2300 --
2301 -- TOC entry 162 (OID 11524715)
2302 -- Name: FUNCTION exectsq(tsvector, tsquery); Type: COMMENT; Schema: public; Owner: postgres
2303 --
2304
2305 COMMENT ON FUNCTION exectsq(tsvector, tsquery) IS 'boolean operation with text index';
2306
2307
2308 --
2309 -- TOC entry 164 (OID 11524716)
2310 -- Name: FUNCTION rexectsq(tsquery, tsvector); Type: COMMENT; Schema: public; Owner: postgres
2311 --
2312
2313 COMMENT ON FUNCTION rexectsq(tsquery, tsvector) IS 'boolean operation with text index';
2314
2315
2316 --
2317 -- TOC entry 45 (OID 11524856)
2318 -- Name: TABLE server_settings; Type: COMMENT; Schema: public; Owner: rich
2319 --
2320
2321 COMMENT ON TABLE server_settings IS 'This table contains global settings for the server.  There should be only one row in this table.  If you modify any setting, you must restart the webserver for the change to take effect.  The "version" field is intended to be some sort of database version, but is currently unused.';
2322
2323
2324 --
2325 -- PostgreSQL database dump
2326 --
2327
2328 SET client_encoding = 'UNICODE';
2329 SET check_function_bodies = false;
2330
2331 SET search_path = public, pg_catalog;
2332
2333 --
2334 -- Data for TOC entry 3 (OID 11524882)
2335 -- Name: templates; Type: TABLE DATA; Schema: public; Owner: rich
2336 --
2337
2338 COPY templates (id, title_regexp, url_regexp, extension, ordering) FROM stdin;
2339 1       ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|1[0-9]|2[0-9]|3[01])$  ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|1[0-9]|2[0-9]|3[01])$  calendar        10
2340 3       ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])$       ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])$       calendar        20
2341 4       ^(199[0-9]|20[0-9][0-9])$       ^(199[0-9]|20[0-9][0-9])$       calendar        30
2342 \.
2343
2344
2345 --
2346 -- TOC entry 2 (OID 11524880)
2347 -- Name: templates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rich
2348 --
2349
2350 SELECT pg_catalog.setval('templates_id_seq', 4, true);
2351
2352
2353 --
2354 -- PostgreSQL database dump
2355 --
2356
2357 SET client_encoding = 'UNICODE';
2358 SET check_function_bodies = false;
2359
2360 SET search_path = public, pg_catalog;
2361
2362 --
2363 -- Data for TOC entry 2 (OID 11524851)
2364 -- Name: themes; Type: TABLE DATA; Schema: public; Owner: rich
2365 --
2366
2367 COPY themes (theme_css, name, description) FROM stdin;
2368 /_css/easyweb.css       Merjis Easy Web Marketing       This is the easy web marketing stylesheet developed by Merjis Ltd.  Please see http://www.merjis.com/
2369 /_css/basic.css Basic styles only       Only the most essential styles.  This is a good starting point if you want to completely restyle pages using site-specific CSS.
2370 \.
2371
2372