Drop table email_notify
[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 5 (OID 536004)
22 -- Name: pages; Type: TABLE; Schema: public; Owner: rich
23 --
24
25 CREATE TABLE pages (
26     id serial NOT NULL,
27     url text,
28     url_deleted text,
29     title text NOT NULL,
30     description text NOT NULL,
31     creation_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
32     last_modified_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
33     hostid integer NOT NULL,
34     logged_ip text,
35     redirect text,
36     css text,
37     logged_user integer
38 );
39
40
41 --
42 -- TOC entry 6 (OID 536004)
43 -- Name: pages; Type: ACL; Schema: public; Owner: rich
44 --
45
46 REVOKE ALL ON TABLE pages FROM PUBLIC;
47 GRANT ALL ON TABLE pages TO "www-data";
48
49
50 --
51 -- TOC entry 46 (OID 536004)
52 -- Name: pages_id_seq; Type: ACL; Schema: public; Owner: rich
53 --
54
55 REVOKE ALL ON TABLE pages_id_seq FROM PUBLIC;
56 GRANT ALL ON TABLE pages_id_seq TO "www-data";
57
58
59 --
60 -- TOC entry 7 (OID 536021)
61 -- Name: contents; Type: TABLE; Schema: public; Owner: rich
62 --
63
64 CREATE TABLE contents (
65     id serial NOT NULL,
66     pageid integer NOT NULL,
67     ordering integer NOT NULL,
68     sectionname text,
69     content text NOT NULL,
70     divname text
71 );
72
73
74 --
75 -- TOC entry 8 (OID 536021)
76 -- Name: contents; Type: ACL; Schema: public; Owner: rich
77 --
78
79 REVOKE ALL ON TABLE contents FROM PUBLIC;
80 GRANT ALL ON TABLE contents TO "www-data";
81
82
83 --
84 -- TOC entry 47 (OID 536021)
85 -- Name: contents_id_seq; Type: ACL; Schema: public; Owner: rich
86 --
87
88 REVOKE ALL ON TABLE contents_id_seq FROM PUBLIC;
89 GRANT ALL ON TABLE contents_id_seq TO "www-data";
90
91
92 --
93 -- TOC entry 9 (OID 536371)
94 -- Name: hosts; Type: TABLE; Schema: public; Owner: rich
95 --
96
97 CREATE TABLE hosts (
98     id serial NOT NULL,
99     canonical_hostname text NOT NULL,
100     css text,
101     edit_anon boolean DEFAULT true NOT NULL,
102     create_account_anon boolean DEFAULT true NOT NULL,
103     theme_css text,
104     feedback_email text,
105     mailing_list boolean DEFAULT false NOT NULL,
106     is_template boolean DEFAULT false NOT NULL,
107     search_box boolean DEFAULT true NOT NULL,
108     view_anon boolean DEFAULT true NOT NULL,
109     navigation boolean DEFAULT false NOT NULL
110 );
111
112
113 --
114 -- TOC entry 10 (OID 536371)
115 -- Name: hosts; Type: ACL; Schema: public; Owner: rich
116 --
117
118 REVOKE ALL ON TABLE hosts FROM PUBLIC;
119 GRANT ALL ON TABLE hosts TO "www-data";
120
121
122 --
123 -- TOC entry 48 (OID 536371)
124 -- Name: hosts_id_seq; Type: ACL; Schema: public; Owner: rich
125 --
126
127 REVOKE ALL ON TABLE hosts_id_seq FROM PUBLIC;
128 GRANT ALL ON TABLE hosts_id_seq TO "www-data";
129
130
131 --
132 -- TOC entry 11 (OID 536379)
133 -- Name: hostnames; Type: TABLE; Schema: public; Owner: rich
134 --
135
136 CREATE TABLE hostnames (
137     hostid integer NOT NULL,
138     name text NOT NULL
139 );
140
141
142 --
143 -- TOC entry 12 (OID 536379)
144 -- Name: hostnames; Type: ACL; Schema: public; Owner: rich
145 --
146
147 REVOKE ALL ON TABLE hostnames FROM PUBLIC;
148 GRANT ALL ON TABLE hostnames TO "www-data";
149
150
151 --
152 -- TOC entry 13 (OID 537151)
153 -- Name: images; Type: TABLE; Schema: public; Owner: rich
154 --
155
156 CREATE TABLE images (
157     id serial NOT NULL,
158     hostid integer NOT NULL,
159     name text,
160     name_deleted text,
161     image bytea NOT NULL,
162     width integer NOT NULL,
163     height integer NOT NULL,
164     alt text NOT NULL,
165     title text,
166     longdesc text,
167     "class" text,
168     mime_type text NOT NULL,
169     thumbnail bytea,
170     tn_width integer,
171     tn_height integer,
172     tn_mime_type text,
173     upload_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
174 );
175
176
177 --
178 -- TOC entry 14 (OID 537151)
179 -- Name: images; Type: ACL; Schema: public; Owner: rich
180 --
181
182 REVOKE ALL ON TABLE images FROM PUBLIC;
183 GRANT ALL ON TABLE images TO "www-data";
184
185
186 --
187 -- TOC entry 49 (OID 537151)
188 -- Name: images_id_seq; Type: ACL; Schema: public; Owner: rich
189 --
190
191 REVOKE ALL ON TABLE images_id_seq FROM PUBLIC;
192 GRANT ALL ON TABLE images_id_seq TO "www-data";
193
194
195 --
196 -- TOC entry 15 (OID 537166)
197 -- Name: files; Type: TABLE; Schema: public; Owner: rich
198 --
199
200 CREATE TABLE files (
201     id serial NOT NULL,
202     hostid integer NOT NULL,
203     name text,
204     name_deleted text,
205     content bytea NOT NULL,
206     title text,
207     mime_type text NOT NULL,
208     upload_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
209 );
210
211
212 --
213 -- TOC entry 16 (OID 537166)
214 -- Name: files; Type: ACL; Schema: public; Owner: rich
215 --
216
217 REVOKE ALL ON TABLE files FROM PUBLIC;
218 GRANT ALL ON TABLE files TO "www-data";
219
220
221 --
222 -- TOC entry 50 (OID 537166)
223 -- Name: files_id_seq; Type: ACL; Schema: public; Owner: rich
224 --
225
226 REVOKE ALL ON TABLE files_id_seq FROM PUBLIC;
227 GRANT ALL ON TABLE files_id_seq TO "www-data";
228
229
230 --
231 -- TOC entry 17 (OID 540816)
232 -- Name: users; Type: TABLE; Schema: public; Owner: rich
233 --
234
235 CREATE TABLE users (
236     id serial NOT NULL,
237     hostid integer NOT NULL,
238     name text NOT NULL,
239     "password" text NOT NULL,
240     email text,
241     registration_date date DEFAULT ('now'::text)::date NOT NULL,
242     can_edit boolean DEFAULT true NOT NULL,
243     can_manage_users boolean DEFAULT false NOT NULL,
244     can_manage_contacts boolean DEFAULT false NOT NULL,
245     can_manage_site boolean DEFAULT false NOT NULL,
246     can_edit_global_css boolean DEFAULT false NOT NULL,
247     force_password_change boolean DEFAULT false NOT NULL,
248     can_import_mail boolean DEFAULT false NOT NULL,
249     email_notify boolean DEFAULT true NOT NULL
250 );
251
252
253 --
254 -- TOC entry 18 (OID 540816)
255 -- Name: users; Type: ACL; Schema: public; Owner: rich
256 --
257
258 REVOKE ALL ON TABLE users FROM PUBLIC;
259 GRANT ALL ON TABLE users TO "www-data";
260
261
262 --
263 -- TOC entry 51 (OID 540816)
264 -- Name: users_id_seq; Type: ACL; Schema: public; Owner: rich
265 --
266
267 REVOKE ALL ON TABLE users_id_seq FROM PUBLIC;
268 GRANT ALL ON TABLE users_id_seq TO "www-data";
269
270
271 --
272 -- TOC entry 19 (OID 540832)
273 -- Name: usercookies; Type: TABLE; Schema: public; Owner: rich
274 --
275
276 CREATE TABLE usercookies (
277     userid integer NOT NULL,
278     cookie text NOT NULL
279 );
280
281
282 --
283 -- TOC entry 20 (OID 540832)
284 -- Name: usercookies; Type: ACL; Schema: public; Owner: rich
285 --
286
287 REVOKE ALL ON TABLE usercookies FROM PUBLIC;
288 GRANT ALL ON TABLE usercookies TO "www-data";
289
290
291 --
292 -- TOC entry 21 (OID 540961)
293 -- Name: sitemenu; Type: TABLE; Schema: public; Owner: rich
294 --
295
296 CREATE TABLE sitemenu (
297     hostid integer NOT NULL,
298     url text NOT NULL,
299     label text NOT NULL,
300     ordering integer NOT NULL
301 );
302
303
304 --
305 -- TOC entry 22 (OID 540961)
306 -- Name: sitemenu; Type: ACL; Schema: public; Owner: rich
307 --
308
309 REVOKE ALL ON TABLE sitemenu FROM PUBLIC;
310 GRANT ALL ON TABLE sitemenu TO "www-data";
311
312
313 --
314 -- TOC entry 23 (OID 542605)
315 -- Name: contacts; Type: TABLE; Schema: public; Owner: rich
316 --
317
318 CREATE TABLE contacts (
319     id serial NOT NULL,
320     hostid integer NOT NULL,
321     name text NOT NULL,
322     subject text NOT NULL
323 );
324
325
326 --
327 -- TOC entry 24 (OID 542605)
328 -- Name: contacts; Type: ACL; Schema: public; Owner: rich
329 --
330
331 REVOKE ALL ON TABLE contacts FROM PUBLIC;
332 GRANT ALL ON TABLE contacts TO "www-data";
333
334
335 --
336 -- TOC entry 52 (OID 542605)
337 -- Name: contacts_id_seq; Type: ACL; Schema: public; Owner: rich
338 --
339
340 REVOKE ALL ON TABLE contacts_id_seq FROM PUBLIC;
341 GRANT ALL ON TABLE contacts_id_seq TO "www-data";
342
343
344 --
345 -- TOC entry 25 (OID 542617)
346 -- Name: contact_emails; Type: TABLE; Schema: public; Owner: rich
347 --
348
349 CREATE TABLE contact_emails (
350     contactid integer NOT NULL,
351     email text NOT NULL
352 );
353
354
355 --
356 -- TOC entry 26 (OID 542617)
357 -- Name: contact_emails; Type: ACL; Schema: public; Owner: rich
358 --
359
360 REVOKE ALL ON TABLE contact_emails FROM PUBLIC;
361 GRANT ALL ON TABLE contact_emails TO "www-data";
362
363
364 --
365 -- TOC entry 27 (OID 543499)
366 -- Name: themes; Type: TABLE; Schema: public; Owner: rich
367 --
368
369 CREATE TABLE themes (
370     theme_css text NOT NULL,
371     name text NOT NULL,
372     description text NOT NULL
373 );
374
375
376 --
377 -- TOC entry 28 (OID 543499)
378 -- Name: themes; Type: ACL; Schema: public; Owner: rich
379 --
380
381 REVOKE ALL ON TABLE themes FROM PUBLIC;
382 GRANT SELECT ON TABLE themes TO "www-data";
383
384
385 --
386 -- TOC entry 29 (OID 543592)
387 -- Name: server_settings; Type: TABLE; Schema: public; Owner: rich
388 --
389
390 CREATE TABLE server_settings (
391     "version" integer NOT NULL,
392     stats_page text,
393     crash_email text
394 );
395
396
397 --
398 -- TOC entry 31 (OID 543592)
399 -- Name: server_settings; Type: ACL; Schema: public; Owner: rich
400 --
401
402 REVOKE ALL ON TABLE server_settings FROM PUBLIC;
403 GRANT SELECT ON TABLE server_settings TO "www-data";
404
405
406 --
407 -- TOC entry 32 (OID 543754)
408 -- Name: page_emails; Type: TABLE; Schema: public; Owner: rich
409 --
410
411 CREATE TABLE page_emails (
412     hostid integer NOT NULL,
413     url text NOT NULL,
414     email text NOT NULL,
415     entry_date date DEFAULT ('now'::text)::date NOT NULL,
416     last_sent date DEFAULT ('now'::text)::date NOT NULL,
417     pending text,
418     opt_out text NOT NULL
419 );
420
421
422 --
423 -- TOC entry 33 (OID 543754)
424 -- Name: page_emails; Type: ACL; Schema: public; Owner: rich
425 --
426
427 REVOKE ALL ON TABLE page_emails FROM PUBLIC;
428 GRANT ALL ON TABLE page_emails TO "www-data";
429
430
431 --
432 -- TOC entry 34 (OID 543785)
433 -- Name: mailing_lists; Type: TABLE; Schema: public; Owner: rich
434 --
435
436 CREATE TABLE mailing_lists (
437     hostid integer NOT NULL,
438     email text NOT NULL,
439     entry_date date DEFAULT ('now'::text)::date NOT NULL,
440     pending text,
441     opt_out text NOT NULL,
442     name text NOT NULL
443 );
444
445
446 --
447 -- TOC entry 35 (OID 543785)
448 -- Name: mailing_lists; Type: ACL; Schema: public; Owner: rich
449 --
450
451 REVOKE ALL ON TABLE mailing_lists FROM PUBLIC;
452 GRANT ALL ON TABLE mailing_lists TO "www-data";
453
454
455 --
456 -- TOC entry 36 (OID 544445)
457 -- Name: links; Type: TABLE; Schema: public; Owner: rich
458 --
459
460 CREATE TABLE links (
461     hostid integer NOT NULL,
462     from_url text NOT NULL,
463     to_url text NOT NULL,
464     CONSTRAINT links_not_selfref_cn CHECK ((from_url <> to_url))
465 );
466
467
468 --
469 -- TOC entry 37 (OID 544445)
470 -- Name: links; Type: ACL; Schema: public; Owner: rich
471 --
472
473 REVOKE ALL ON TABLE links FROM PUBLIC;
474 GRANT ALL ON TABLE links TO "www-data";
475
476
477 --
478 -- TOC entry 38 (OID 547939)
479 -- Name: templates; Type: TABLE; Schema: public; Owner: rich
480 --
481
482 CREATE TABLE templates (
483     id serial NOT NULL,
484     title_regexp text NOT NULL,
485     url_regexp text NOT NULL,
486     extension text NOT NULL,
487     ordering integer NOT NULL
488 );
489
490
491 --
492 -- TOC entry 39 (OID 547939)
493 -- Name: templates; Type: ACL; Schema: public; Owner: rich
494 --
495
496 REVOKE ALL ON TABLE templates FROM PUBLIC;
497 GRANT SELECT ON TABLE templates TO "www-data";
498
499
500 --
501 -- TOC entry 53 (OID 547939)
502 -- Name: templates_id_seq; Type: ACL; Schema: public; Owner: rich
503 --
504
505 REVOKE ALL ON TABLE templates_id_seq FROM PUBLIC;
506
507
508 --
509 -- TOC entry 40 (OID 551123)
510 -- Name: recently_visited; Type: TABLE; Schema: public; Owner: rich
511 --
512
513 CREATE TABLE recently_visited (
514     userid integer NOT NULL,
515     hostid integer NOT NULL,
516     url text NOT NULL,
517     visit_time timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
518 );
519
520
521 --
522 -- TOC entry 41 (OID 551123)
523 -- Name: recently_visited; Type: ACL; Schema: public; Owner: rich
524 --
525
526 REVOKE ALL ON TABLE recently_visited FROM PUBLIC;
527 GRANT ALL ON TABLE recently_visited TO "www-data";
528
529
530 --
531 -- TOC entry 42 (OID 551675)
532 -- Name: messages; Type: TABLE; Schema: public; Owner: rich
533 --
534
535 CREATE TABLE messages (
536     id serial NOT NULL,
537     subject text NOT NULL,
538     inet_message_id text NOT NULL,
539     message_date timestamp with time zone NOT NULL,
540     hostid integer NOT NULL
541 );
542
543
544 --
545 -- TOC entry 43 (OID 551675)
546 -- Name: messages; Type: ACL; Schema: public; Owner: rich
547 --
548
549 REVOKE ALL ON TABLE messages FROM PUBLIC;
550 GRANT ALL ON TABLE messages TO "www-data";
551
552
553 --
554 -- TOC entry 54 (OID 551675)
555 -- Name: messages_id_seq; Type: ACL; Schema: public; Owner: rich
556 --
557
558 REVOKE ALL ON TABLE messages_id_seq FROM PUBLIC;
559 GRANT ALL ON TABLE messages_id_seq TO "www-data";
560
561
562 --
563 -- TOC entry 44 (OID 551685)
564 -- Name: msg_references; Type: TABLE; Schema: public; Owner: rich
565 --
566
567 CREATE TABLE msg_references (
568     message_id integer NOT NULL,
569     inet_message_id text NOT NULL,
570     ordering integer NOT NULL
571 );
572
573
574 --
575 -- TOC entry 45 (OID 551685)
576 -- Name: msg_references; Type: ACL; Schema: public; Owner: rich
577 --
578
579 REVOKE ALL ON TABLE msg_references FROM PUBLIC;
580 GRANT ALL ON TABLE msg_references TO "www-data";
581
582
583 --
584 -- TOC entry 61 (OID 536388)
585 -- Name: hostnames_hostid_name_uq; Type: INDEX; Schema: public; Owner: rich
586 --
587
588 CREATE UNIQUE INDEX hostnames_hostid_name_uq ON hostnames USING btree (hostid, name);
589
590
591 --
592 -- TOC entry 62 (OID 536389)
593 -- Name: hostnams_name_uq; Type: INDEX; Schema: public; Owner: rich
594 --
595
596 CREATE UNIQUE INDEX hostnams_name_uq ON hostnames USING btree (name);
597
598
599 --
600 -- TOC entry 58 (OID 536419)
601 -- Name: pages_url_uq; Type: INDEX; Schema: public; Owner: rich
602 --
603
604 CREATE UNIQUE INDEX pages_url_uq ON pages USING btree (hostid, url);
605
606
607 --
608 -- TOC entry 63 (OID 540251)
609 -- Name: images_name_uq; Type: INDEX; Schema: public; Owner: rich
610 --
611
612 CREATE UNIQUE INDEX images_name_uq ON images USING btree (hostid, name);
613
614
615 --
616 -- TOC entry 65 (OID 540252)
617 -- Name: files_name_uq; Type: INDEX; Schema: public; Owner: rich
618 --
619
620 CREATE UNIQUE INDEX files_name_uq ON files USING btree (hostid, name);
621
622
623 --
624 -- TOC entry 68 (OID 540831)
625 -- Name: users_name_uq; Type: INDEX; Schema: public; Owner: rich
626 --
627
628 CREATE UNIQUE INDEX users_name_uq ON users USING btree (hostid, name);
629
630
631 --
632 -- TOC entry 67 (OID 540946)
633 -- Name: users_id_uq; Type: INDEX; Schema: public; Owner: rich
634 --
635
636 CREATE UNIQUE INDEX users_id_uq ON users USING btree (hostid, id);
637
638
639 --
640 -- TOC entry 70 (OID 540970)
641 -- Name: sitemenu_ordering_uq; Type: INDEX; Schema: public; Owner: rich
642 --
643
644 CREATE UNIQUE INDEX sitemenu_ordering_uq ON sitemenu USING btree (hostid, ordering);
645
646
647 --
648 -- TOC entry 71 (OID 540971)
649 -- Name: sitemenu_url_uq; Type: INDEX; Schema: public; Owner: rich
650 --
651
652 CREATE UNIQUE INDEX sitemenu_url_uq ON sitemenu USING btree (hostid, url);
653
654
655 --
656 -- TOC entry 74 (OID 542626)
657 -- Name: contact_emails_uq; Type: INDEX; Schema: public; Owner: rich
658 --
659
660 CREATE UNIQUE INDEX contact_emails_uq ON contact_emails USING btree (contactid, email);
661
662
663 --
664 -- TOC entry 75 (OID 543505)
665 -- Name: themes_theme_css_uq; Type: INDEX; Schema: public; Owner: rich
666 --
667
668 CREATE UNIQUE INDEX themes_theme_css_uq ON themes USING btree (theme_css);
669
670
671 --
672 -- TOC entry 76 (OID 543763)
673 -- Name: page_emails_email_uq; Type: INDEX; Schema: public; Owner: rich
674 --
675
676 CREATE UNIQUE INDEX page_emails_email_uq ON page_emails USING btree (hostid, url, email);
677
678
679 --
680 -- TOC entry 77 (OID 543795)
681 -- Name: mailing_lists_email_uq; Type: INDEX; Schema: public; Owner: rich
682 --
683
684 CREATE UNIQUE INDEX mailing_lists_email_uq ON mailing_lists USING btree (hostid, email);
685
686
687 --
688 -- TOC entry 72 (OID 543880)
689 -- Name: contacts_name_uq; Type: INDEX; Schema: public; Owner: rich
690 --
691
692 CREATE UNIQUE INDEX contacts_name_uq ON contacts USING btree (hostid, name);
693
694
695 --
696 -- TOC entry 78 (OID 544454)
697 -- Name: links_uq; Type: INDEX; Schema: public; Owner: rich
698 --
699
700 CREATE UNIQUE INDEX links_uq ON links USING btree (hostid, from_url, to_url);
701
702
703 --
704 -- TOC entry 79 (OID 547951)
705 -- Name: templates_ext_ord_uq; Type: INDEX; Schema: public; Owner: rich
706 --
707
708 CREATE UNIQUE INDEX templates_ext_ord_uq ON templates USING btree (extension, ordering);
709
710
711 --
712 -- TOC entry 81 (OID 547952)
713 -- Name: templates_title_uq; Type: INDEX; Schema: public; Owner: rich
714 --
715
716 CREATE UNIQUE INDEX templates_title_uq ON templates USING btree (title_regexp);
717
718
719 --
720 -- TOC entry 82 (OID 547953)
721 -- Name: templates_url_uq; Type: INDEX; Schema: public; Owner: rich
722 --
723
724 CREATE UNIQUE INDEX templates_url_uq ON templates USING btree (url_regexp);
725
726
727 --
728 -- TOC entry 83 (OID 551151)
729 -- Name: recently_visited_uq; Type: INDEX; Schema: public; Owner: rich
730 --
731
732 CREATE UNIQUE INDEX recently_visited_uq ON recently_visited USING btree (userid, hostid, url);
733
734
735 --
736 -- TOC entry 84 (OID 552155)
737 -- Name: messages_inet_message_id_uq; Type: INDEX; Schema: public; Owner: rich
738 --
739
740 CREATE UNIQUE INDEX messages_inet_message_id_uq ON messages USING btree (hostid, inet_message_id);
741
742
743 --
744 -- TOC entry 57 (OID 552684)
745 -- Name: pages_url_ix; Type: INDEX; Schema: public; Owner: rich
746 --
747
748 CREATE INDEX pages_url_ix ON pages USING btree (url);
749
750
751 --
752 -- TOC entry 56 (OID 552685)
753 -- Name: pages_redirect_ix; Type: INDEX; Schema: public; Owner: rich
754 --
755
756 CREATE INDEX pages_redirect_ix ON pages USING btree (redirect);
757
758
759 --
760 -- TOC entry 55 (OID 536012)
761 -- Name: pages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
762 --
763
764 ALTER TABLE ONLY pages
765     ADD CONSTRAINT pages_pkey PRIMARY KEY (id);
766
767
768 --
769 -- TOC entry 59 (OID 536027)
770 -- Name: contents_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
771 --
772
773 ALTER TABLE ONLY contents
774     ADD CONSTRAINT contents_pkey PRIMARY KEY (id);
775
776
777 --
778 -- TOC entry 60 (OID 536377)
779 -- Name: hosts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
780 --
781
782 ALTER TABLE ONLY hosts
783     ADD CONSTRAINT hosts_pkey PRIMARY KEY (id);
784
785
786 --
787 -- TOC entry 64 (OID 537158)
788 -- Name: images_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
789 --
790
791 ALTER TABLE ONLY images
792     ADD CONSTRAINT images_pkey PRIMARY KEY (id);
793
794
795 --
796 -- TOC entry 66 (OID 537173)
797 -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
798 --
799
800 ALTER TABLE ONLY files
801     ADD CONSTRAINT files_pkey PRIMARY KEY (id);
802
803
804 --
805 -- TOC entry 69 (OID 540825)
806 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
807 --
808
809 ALTER TABLE ONLY users
810     ADD CONSTRAINT users_pkey PRIMARY KEY (id);
811
812
813 --
814 -- TOC entry 73 (OID 542611)
815 -- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
816 --
817
818 ALTER TABLE ONLY contacts
819     ADD CONSTRAINT contacts_pkey PRIMARY KEY (id);
820
821
822 --
823 -- TOC entry 80 (OID 547945)
824 -- Name: templates_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
825 --
826
827 ALTER TABLE ONLY templates
828     ADD CONSTRAINT templates_pkey PRIMARY KEY (id);
829
830
831 --
832 -- TOC entry 85 (OID 551681)
833 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
834 --
835
836 ALTER TABLE ONLY messages
837     ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
838
839
840 --
841 -- TOC entry 90 (OID 536029)
842 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
843 --
844
845 ALTER TABLE ONLY contents
846     ADD CONSTRAINT "$1" FOREIGN KEY (pageid) REFERENCES pages(id);
847
848
849 --
850 -- TOC entry 93 (OID 536384)
851 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
852 --
853
854 ALTER TABLE ONLY hostnames
855     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
856
857
858 --
859 -- TOC entry 91 (OID 536394)
860 -- Name: hosts_hostname_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
861 --
862
863 ALTER TABLE ONLY hosts
864     ADD CONSTRAINT hosts_hostname_cn FOREIGN KEY (id, canonical_hostname) REFERENCES hostnames(hostid, name) DEFERRABLE;
865
866
867 --
868 -- TOC entry 86 (OID 536404)
869 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
870 --
871
872 ALTER TABLE ONLY pages
873     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
874
875
876 --
877 -- TOC entry 94 (OID 537160)
878 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
879 --
880
881 ALTER TABLE ONLY images
882     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
883
884
885 --
886 -- TOC entry 95 (OID 537175)
887 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
888 --
889
890 ALTER TABLE ONLY files
891     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
892
893
894 --
895 -- TOC entry 87 (OID 539155)
896 -- Name: pages_redirect_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
897 --
898
899 ALTER TABLE ONLY pages
900     ADD CONSTRAINT pages_redirect_cn FOREIGN KEY (hostid, redirect) REFERENCES pages(hostid, url) DEFERRABLE;
901
902
903 --
904 -- TOC entry 96 (OID 540827)
905 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
906 --
907
908 ALTER TABLE ONLY users
909     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
910
911
912 --
913 -- TOC entry 97 (OID 540837)
914 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
915 --
916
917 ALTER TABLE ONLY usercookies
918     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
919
920
921 --
922 -- TOC entry 88 (OID 540942)
923 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
924 --
925
926 ALTER TABLE ONLY pages
927     ADD CONSTRAINT "$2" FOREIGN KEY (logged_user) REFERENCES users(id);
928
929
930 --
931 -- TOC entry 89 (OID 540947)
932 -- Name: pages_user_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
933 --
934
935 ALTER TABLE ONLY pages
936     ADD CONSTRAINT pages_user_cn FOREIGN KEY (hostid, logged_user) REFERENCES users(hostid, id);
937
938
939 --
940 -- TOC entry 98 (OID 540966)
941 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
942 --
943
944 ALTER TABLE ONLY sitemenu
945     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
946
947
948 --
949 -- TOC entry 99 (OID 540972)
950 -- Name: sitemenu_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
951 --
952
953 ALTER TABLE ONLY sitemenu
954     ADD CONSTRAINT sitemenu_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
955
956
957 --
958 -- TOC entry 100 (OID 542613)
959 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
960 --
961
962 ALTER TABLE ONLY contacts
963     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
964
965
966 --
967 -- TOC entry 101 (OID 542622)
968 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
969 --
970
971 ALTER TABLE ONLY contact_emails
972     ADD CONSTRAINT "$1" FOREIGN KEY (contactid) REFERENCES contacts(id);
973
974
975 --
976 -- TOC entry 92 (OID 543506)
977 -- Name: hosts_theme_css_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
978 --
979
980 ALTER TABLE ONLY hosts
981     ADD CONSTRAINT hosts_theme_css_cn FOREIGN KEY (theme_css) REFERENCES themes(theme_css);
982
983
984 --
985 -- TOC entry 102 (OID 543759)
986 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
987 --
988
989 ALTER TABLE ONLY page_emails
990     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
991
992
993 --
994 -- TOC entry 103 (OID 543764)
995 -- Name: page_emails_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
996 --
997
998 ALTER TABLE ONLY page_emails
999     ADD CONSTRAINT page_emails_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
1000
1001
1002 --
1003 -- TOC entry 104 (OID 543791)
1004 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
1005 --
1006
1007 ALTER TABLE ONLY mailing_lists
1008     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
1009
1010
1011 --
1012 -- TOC entry 105 (OID 544450)
1013 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
1014 --
1015
1016 ALTER TABLE ONLY links
1017     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
1018
1019
1020 --
1021 -- TOC entry 106 (OID 544455)
1022 -- Name: links_from_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
1023 --
1024
1025 ALTER TABLE ONLY links
1026     ADD CONSTRAINT links_from_cn FOREIGN KEY (hostid, from_url) REFERENCES pages(hostid, url) DEFERRABLE;
1027
1028
1029 --
1030 -- TOC entry 107 (OID 551129)
1031 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
1032 --
1033
1034 ALTER TABLE ONLY recently_visited
1035     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
1036
1037
1038 --
1039 -- TOC entry 108 (OID 551133)
1040 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
1041 --
1042
1043 ALTER TABLE ONLY recently_visited
1044     ADD CONSTRAINT "$2" FOREIGN KEY (hostid) REFERENCES hosts(id);
1045
1046
1047 --
1048 -- TOC entry 109 (OID 551137)
1049 -- Name: recently_visited_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
1050 --
1051
1052 ALTER TABLE ONLY recently_visited
1053     ADD CONSTRAINT recently_visited_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
1054
1055
1056 --
1057 -- TOC entry 110 (OID 551141)
1058 -- Name: recently_visited_userid_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
1059 --
1060
1061 ALTER TABLE ONLY recently_visited
1062     ADD CONSTRAINT recently_visited_userid_cn FOREIGN KEY (hostid, userid) REFERENCES users(hostid, id);
1063
1064
1065 --
1066 -- TOC entry 112 (OID 551690)
1067 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
1068 --
1069
1070 ALTER TABLE ONLY msg_references
1071     ADD CONSTRAINT "$1" FOREIGN KEY (message_id) REFERENCES messages(id);
1072
1073
1074 --
1075 -- TOC entry 111 (OID 551694)
1076 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
1077 --
1078
1079 ALTER TABLE ONLY messages
1080     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
1081
1082
1083 --
1084 -- TOC entry 3 (OID 2200)
1085 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
1086 --
1087
1088 COMMENT ON SCHEMA public IS 'Standard public namespace';
1089
1090
1091 --
1092 -- TOC entry 30 (OID 543592)
1093 -- Name: TABLE server_settings; Type: COMMENT; Schema: public; Owner: rich
1094 --
1095
1096 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.';
1097
1098
1099 --
1100 -- PostgreSQL database dump
1101 --
1102
1103 SET client_encoding = 'UNICODE';
1104 SET check_function_bodies = false;
1105
1106 SET search_path = public, pg_catalog;
1107
1108 --
1109 -- Data for TOC entry 3 (OID 547939)
1110 -- Name: templates; Type: TABLE DATA; Schema: public; Owner: rich
1111 --
1112
1113 COPY templates (id, title_regexp, url_regexp, extension, ordering) FROM stdin;
1114 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
1115 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
1116 4       ^(199[0-9]|20[0-9][0-9])$       ^(199[0-9]|20[0-9][0-9])$       calendar        30
1117 \.
1118
1119
1120 --
1121 -- TOC entry 2 (OID 547937)
1122 -- Name: templates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rich
1123 --
1124
1125 SELECT pg_catalog.setval('templates_id_seq', 4, true);
1126
1127
1128 --
1129 -- PostgreSQL database dump
1130 --
1131
1132 SET client_encoding = 'UNICODE';
1133 SET check_function_bodies = false;
1134
1135 SET search_path = public, pg_catalog;
1136
1137 --
1138 -- Data for TOC entry 2 (OID 543499)
1139 -- Name: themes; Type: TABLE DATA; Schema: public; Owner: rich
1140 --
1141
1142 COPY themes (theme_css, name, description) FROM stdin;
1143 /_css/easyweb.css       Merjis Easy Web Marketing       This is the easy web marketing stylesheet developed by Merjis Ltd.  Please see http://www.merjis.com/
1144 /_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.
1145 \.
1146
1147