summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/weblog-database.sql
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2011-08-28 01:14:40 +0200
committerDavid A. Madore <david+git@madore.org>2011-08-28 01:14:40 +0200
commit0003925549ea009bb0a99c225b5d1992ccd8e7af (patch)
tree62e6e5d30ba2d216a4d1a4e0e0b06aaf8aadc3ba /org/madore/damlengine/weblog-database.sql
parentdd50b6000a13e9010c7688fa4b328fdebd323783 (diff)
downloaddamlengine-0003925549ea009bb0a99c225b5d1992ccd8e7af.tar.gz
damlengine-0003925549ea009bb0a99c225b5d1992ccd8e7af.tar.bz2
damlengine-0003925549ea009bb0a99c225b5d1992ccd8e7af.zip
Preliminary code to populate a PostgreSQL database with weblog entries.
Diffstat (limited to 'org/madore/damlengine/weblog-database.sql')
-rw-r--r--org/madore/damlengine/weblog-database.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/org/madore/damlengine/weblog-database.sql b/org/madore/damlengine/weblog-database.sql
new file mode 100644
index 0000000..ab4146d
--- /dev/null
+++ b/org/madore/damlengine/weblog-database.sql
@@ -0,0 +1,20 @@
+SET TIME ZONE 0;
+CREATE TABLE entries (
+ id integer PRIMARY KEY ,
+ edate text NOT NULL ,
+ cdate timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP ,
+ mdate timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP ,
+ lang text ,
+ title text ,
+ title_xml xml ,
+ content xml NOT NULL,
+ sha1 text NOT NULL
+) ;
+CREATE INDEX entries_edate_key ON entries ( edate ) ;
+CREATE TABLE incat (
+ id integer NOT NULL ,
+ code text NOT NULL ,
+ FOREIGN KEY ( id ) REFERENCES entries ( id ) ON DELETE CASCADE
+) ;
+CREATE INDEX incat_id_key ON incat ( id ) ;
+CREATE INDEX incat_code_key ON incat ( code ) ;