Templates table added to the database.
authorrich <rich>
Thu, 7 Oct 2004 12:49:15 +0000 (12:49 +0000)
committerrich <rich>
Thu, 7 Oct 2004 12:49:15 +0000 (12:49 +0000)
Makefile
cocanwiki.sql

index c99e7e5..6594c47 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.9 2004/09/29 15:03:10 rich Exp $
+# $Id: Makefile,v 1.10 2004/10/07 12:49:15 rich Exp $
 
 include Makefile.config
 
@@ -45,7 +45,7 @@ clean:
        find \( -name '*~' -o -name core \) -a -exec rm {} \;
        $(MAKE) -C scripts clean
 
-FIXED_TABLES := themes
+FIXED_TABLES := templates themes
 
 cocanwiki.sql:
        pg_dump --no-owner -i -s cocanwiki > $@
index 850cb67..c809326 100644 (file)
@@ -48,7 +48,7 @@ GRANT ALL ON TABLE pages TO "www-data";
 
 
 --
--- TOC entry 40 (OID 536004)
+-- TOC entry 42 (OID 536004)
 -- Name: pages_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -81,7 +81,7 @@ GRANT ALL ON TABLE contents TO "www-data";
 
 
 --
--- TOC entry 41 (OID 536021)
+-- TOC entry 43 (OID 536021)
 -- Name: contents_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -119,7 +119,7 @@ GRANT ALL ON TABLE hosts TO "www-data";
 
 
 --
--- TOC entry 42 (OID 536371)
+-- TOC entry 44 (OID 536371)
 -- Name: hosts_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -204,7 +204,7 @@ GRANT ALL ON TABLE images TO "www-data";
 
 
 --
--- TOC entry 43 (OID 537151)
+-- TOC entry 45 (OID 537151)
 -- Name: images_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -239,7 +239,7 @@ GRANT ALL ON TABLE files TO "www-data";
 
 
 --
--- TOC entry 44 (OID 537166)
+-- TOC entry 46 (OID 537166)
 -- Name: files_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -278,7 +278,7 @@ GRANT ALL ON TABLE users TO "www-data";
 
 
 --
--- TOC entry 45 (OID 540816)
+-- TOC entry 47 (OID 540816)
 -- Name: users_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -351,7 +351,7 @@ GRANT ALL ON TABLE contacts TO "www-data";
 
 
 --
--- TOC entry 46 (OID 542605)
+-- TOC entry 48 (OID 542605)
 -- Name: contacts_id_seq; Type: ACL; Schema: public; Owner: rich
 --
 
@@ -492,7 +492,38 @@ GRANT ALL ON TABLE links TO "www-data";
 
 
 --
--- TOC entry 51 (OID 536388)
+-- TOC entry 40 (OID 547939)
+-- Name: templates; Type: TABLE; Schema: public; Owner: rich
+--
+
+CREATE TABLE templates (
+    id serial NOT NULL,
+    title_regexp text NOT NULL,
+    url_regexp text NOT NULL,
+    extension text NOT NULL,
+    ordering integer NOT NULL
+);
+
+
+--
+-- TOC entry 41 (OID 547939)
+-- Name: templates; Type: ACL; Schema: public; Owner: rich
+--
+
+REVOKE ALL ON TABLE templates FROM PUBLIC;
+GRANT SELECT ON TABLE templates TO "www-data";
+
+
+--
+-- TOC entry 49 (OID 547939)
+-- Name: templates_id_seq; Type: ACL; Schema: public; Owner: rich
+--
+
+REVOKE ALL ON TABLE templates_id_seq FROM PUBLIC;
+
+
+--
+-- TOC entry 54 (OID 536388)
 -- Name: hostnames_hostid_name_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -500,7 +531,7 @@ CREATE UNIQUE INDEX hostnames_hostid_name_uq ON hostnames USING btree (hostid, n
 
 
 --
--- TOC entry 52 (OID 536389)
+-- TOC entry 55 (OID 536389)
 -- Name: hostnams_name_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -508,7 +539,7 @@ CREATE UNIQUE INDEX hostnams_name_uq ON hostnames USING btree (name);
 
 
 --
--- TOC entry 48 (OID 536419)
+-- TOC entry 51 (OID 536419)
 -- Name: pages_url_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -516,7 +547,7 @@ CREATE UNIQUE INDEX pages_url_uq ON pages USING btree (hostid, url);
 
 
 --
--- TOC entry 53 (OID 536924)
+-- TOC entry 56 (OID 536924)
 -- Name: email_notify_email_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -524,7 +555,7 @@ CREATE UNIQUE INDEX email_notify_email_uq ON email_notify USING btree (hostid, e
 
 
 --
--- TOC entry 54 (OID 540251)
+-- TOC entry 57 (OID 540251)
 -- Name: images_name_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -532,7 +563,7 @@ CREATE UNIQUE INDEX images_name_uq ON images USING btree (hostid, name);
 
 
 --
--- TOC entry 56 (OID 540252)
+-- TOC entry 59 (OID 540252)
 -- Name: files_name_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -540,7 +571,7 @@ CREATE UNIQUE INDEX files_name_uq ON files USING btree (hostid, name);
 
 
 --
--- TOC entry 59 (OID 540831)
+-- TOC entry 62 (OID 540831)
 -- Name: users_name_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -548,7 +579,7 @@ CREATE UNIQUE INDEX users_name_uq ON users USING btree (hostid, name);
 
 
 --
--- TOC entry 58 (OID 540946)
+-- TOC entry 61 (OID 540946)
 -- Name: users_id_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -556,7 +587,7 @@ CREATE UNIQUE INDEX users_id_uq ON users USING btree (hostid, id);
 
 
 --
--- TOC entry 61 (OID 540970)
+-- TOC entry 64 (OID 540970)
 -- Name: sitemenu_ordering_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -564,7 +595,7 @@ CREATE UNIQUE INDEX sitemenu_ordering_uq ON sitemenu USING btree (hostid, orderi
 
 
 --
--- TOC entry 62 (OID 540971)
+-- TOC entry 65 (OID 540971)
 -- Name: sitemenu_url_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -572,7 +603,7 @@ CREATE UNIQUE INDEX sitemenu_url_uq ON sitemenu USING btree (hostid, url);
 
 
 --
--- TOC entry 65 (OID 542626)
+-- TOC entry 68 (OID 542626)
 -- Name: contact_emails_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -580,7 +611,7 @@ CREATE UNIQUE INDEX contact_emails_uq ON contact_emails USING btree (contactid,
 
 
 --
--- TOC entry 66 (OID 543505)
+-- TOC entry 69 (OID 543505)
 -- Name: themes_theme_css_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -588,7 +619,7 @@ CREATE UNIQUE INDEX themes_theme_css_uq ON themes USING btree (theme_css);
 
 
 --
--- TOC entry 67 (OID 543763)
+-- TOC entry 70 (OID 543763)
 -- Name: page_emails_email_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -596,7 +627,7 @@ CREATE UNIQUE INDEX page_emails_email_uq ON page_emails USING btree (hostid, url
 
 
 --
--- TOC entry 68 (OID 543795)
+-- TOC entry 71 (OID 543795)
 -- Name: mailing_lists_email_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -604,7 +635,7 @@ CREATE UNIQUE INDEX mailing_lists_email_uq ON mailing_lists USING btree (hostid,
 
 
 --
--- TOC entry 63 (OID 543880)
+-- TOC entry 66 (OID 543880)
 -- Name: contacts_name_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -612,7 +643,7 @@ CREATE UNIQUE INDEX contacts_name_uq ON contacts USING btree (hostid, name);
 
 
 --
--- TOC entry 69 (OID 544454)
+-- TOC entry 72 (OID 544454)
 -- Name: links_uq; Type: INDEX; Schema: public; Owner: rich
 --
 
@@ -620,7 +651,31 @@ CREATE UNIQUE INDEX links_uq ON links USING btree (hostid, from_url, to_url);
 
 
 --
--- TOC entry 47 (OID 536012)
+-- TOC entry 73 (OID 547951)
+-- Name: templates_ext_ord_uq; Type: INDEX; Schema: public; Owner: rich
+--
+
+CREATE UNIQUE INDEX templates_ext_ord_uq ON templates USING btree (extension, ordering);
+
+
+--
+-- TOC entry 75 (OID 547952)
+-- Name: templates_title_uq; Type: INDEX; Schema: public; Owner: rich
+--
+
+CREATE UNIQUE INDEX templates_title_uq ON templates USING btree (title_regexp);
+
+
+--
+-- TOC entry 76 (OID 547953)
+-- Name: templates_url_uq; Type: INDEX; Schema: public; Owner: rich
+--
+
+CREATE UNIQUE INDEX templates_url_uq ON templates USING btree (url_regexp);
+
+
+--
+-- TOC entry 50 (OID 536012)
 -- Name: pages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -629,7 +684,7 @@ ALTER TABLE ONLY pages
 
 
 --
--- TOC entry 49 (OID 536027)
+-- TOC entry 52 (OID 536027)
 -- Name: contents_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -638,7 +693,7 @@ ALTER TABLE ONLY contents
 
 
 --
--- TOC entry 50 (OID 536377)
+-- TOC entry 53 (OID 536377)
 -- Name: hosts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -647,7 +702,7 @@ ALTER TABLE ONLY hosts
 
 
 --
--- TOC entry 55 (OID 537158)
+-- TOC entry 58 (OID 537158)
 -- Name: images_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -656,7 +711,7 @@ ALTER TABLE ONLY images
 
 
 --
--- TOC entry 57 (OID 537173)
+-- TOC entry 60 (OID 537173)
 -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -665,7 +720,7 @@ ALTER TABLE ONLY files
 
 
 --
--- TOC entry 60 (OID 540825)
+-- TOC entry 63 (OID 540825)
 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -674,7 +729,7 @@ ALTER TABLE ONLY users
 
 
 --
--- TOC entry 64 (OID 542611)
+-- TOC entry 67 (OID 542611)
 -- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -683,7 +738,16 @@ ALTER TABLE ONLY contacts
 
 
 --
--- TOC entry 74 (OID 536029)
+-- TOC entry 74 (OID 547945)
+-- Name: templates_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
+--
+
+ALTER TABLE ONLY templates
+    ADD CONSTRAINT templates_pkey PRIMARY KEY (id);
+
+
+--
+-- TOC entry 81 (OID 536029)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -692,7 +756,7 @@ ALTER TABLE ONLY contents
 
 
 --
--- TOC entry 77 (OID 536384)
+-- TOC entry 84 (OID 536384)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -701,7 +765,7 @@ ALTER TABLE ONLY hostnames
 
 
 --
--- TOC entry 75 (OID 536394)
+-- TOC entry 82 (OID 536394)
 -- Name: hosts_hostname_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -710,7 +774,7 @@ ALTER TABLE ONLY hosts
 
 
 --
--- TOC entry 70 (OID 536404)
+-- TOC entry 77 (OID 536404)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -719,7 +783,7 @@ ALTER TABLE ONLY pages
 
 
 --
--- TOC entry 78 (OID 536920)
+-- TOC entry 85 (OID 536920)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -728,7 +792,7 @@ ALTER TABLE ONLY email_notify
 
 
 --
--- TOC entry 79 (OID 537160)
+-- TOC entry 86 (OID 537160)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -737,7 +801,7 @@ ALTER TABLE ONLY images
 
 
 --
--- TOC entry 80 (OID 537175)
+-- TOC entry 87 (OID 537175)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -746,7 +810,7 @@ ALTER TABLE ONLY files
 
 
 --
--- TOC entry 71 (OID 539155)
+-- TOC entry 78 (OID 539155)
 -- Name: pages_redirect_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -755,7 +819,7 @@ ALTER TABLE ONLY pages
 
 
 --
--- TOC entry 81 (OID 540827)
+-- TOC entry 88 (OID 540827)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -764,7 +828,7 @@ ALTER TABLE ONLY users
 
 
 --
--- TOC entry 82 (OID 540837)
+-- TOC entry 89 (OID 540837)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -773,7 +837,7 @@ ALTER TABLE ONLY usercookies
 
 
 --
--- TOC entry 72 (OID 540942)
+-- TOC entry 79 (OID 540942)
 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -782,7 +846,7 @@ ALTER TABLE ONLY pages
 
 
 --
--- TOC entry 73 (OID 540947)
+-- TOC entry 80 (OID 540947)
 -- Name: pages_user_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -791,7 +855,7 @@ ALTER TABLE ONLY pages
 
 
 --
--- TOC entry 83 (OID 540966)
+-- TOC entry 90 (OID 540966)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -800,7 +864,7 @@ ALTER TABLE ONLY sitemenu
 
 
 --
--- TOC entry 84 (OID 540972)
+-- TOC entry 91 (OID 540972)
 -- Name: sitemenu_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -809,7 +873,7 @@ ALTER TABLE ONLY sitemenu
 
 
 --
--- TOC entry 85 (OID 542613)
+-- TOC entry 92 (OID 542613)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -818,7 +882,7 @@ ALTER TABLE ONLY contacts
 
 
 --
--- TOC entry 86 (OID 542622)
+-- TOC entry 93 (OID 542622)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -827,7 +891,7 @@ ALTER TABLE ONLY contact_emails
 
 
 --
--- TOC entry 76 (OID 543506)
+-- TOC entry 83 (OID 543506)
 -- Name: hosts_theme_css_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -836,7 +900,7 @@ ALTER TABLE ONLY hosts
 
 
 --
--- TOC entry 87 (OID 543759)
+-- TOC entry 94 (OID 543759)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -845,7 +909,7 @@ ALTER TABLE ONLY page_emails
 
 
 --
--- TOC entry 88 (OID 543764)
+-- TOC entry 95 (OID 543764)
 -- Name: page_emails_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -854,7 +918,7 @@ ALTER TABLE ONLY page_emails
 
 
 --
--- TOC entry 89 (OID 543791)
+-- TOC entry 96 (OID 543791)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -863,7 +927,7 @@ ALTER TABLE ONLY mailing_lists
 
 
 --
--- TOC entry 90 (OID 544450)
+-- TOC entry 97 (OID 544450)
 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -872,7 +936,7 @@ ALTER TABLE ONLY links
 
 
 --
--- TOC entry 91 (OID 544455)
+-- TOC entry 98 (OID 544455)
 -- Name: links_from_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
 --
 
@@ -906,6 +970,35 @@ SET check_function_bodies = false;
 SET search_path = public, pg_catalog;
 
 --
+-- Data for TOC entry 3 (OID 547939)
+-- Name: templates; Type: TABLE DATA; Schema: public; Owner: rich
+--
+
+COPY templates (id, title_regexp, url_regexp, extension, ordering) FROM stdin;
+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
+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
+4      (199[0-9]|20[0-9][0-9]) (199[0-9]|20[0-9][0-9]) calendar        30
+\.
+
+
+--
+-- TOC entry 2 (OID 547937)
+-- Name: templates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rich
+--
+
+SELECT pg_catalog.setval('templates_id_seq', 4, true);
+
+
+--
+-- PostgreSQL database dump
+--
+
+SET client_encoding = 'UNICODE';
+SET check_function_bodies = false;
+
+SET search_path = public, pg_catalog;
+
+--
 -- Data for TOC entry 2 (OID 543499)
 -- Name: themes; Type: TABLE DATA; Schema: public; Owner: rich
 --