From 2d698a74f90b0915dd8c2e3e42ce0f21d0a7bd1c Mon Sep 17 00:00:00 2001
From: Matthias Andreas Benkard <code@mail.matthias.benkard.de>
Date: Wed, 2 Mar 2011 16:19:50 +0100
Subject: Add comment support to article template, add support for multiple
 page templates.

---
 schema.sql | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 914398c..909f6b3 100644
--- a/schema.sql
+++ b/schema.sql
@@ -40,11 +40,20 @@ CREATE TABLE login_certificates(
   FOREIGN KEY ("user") REFERENCES users
 );
 
-CREATE TABLE articles(
-  id SERIAL NOT NULL,
+CREATE TABLE article_types(
+  id            SERIAL NOT NULL,
+  name          VARCHAR,
+  page_template VARCHAR,
   PRIMARY KEY (id)
 );
 
+CREATE TABLE articles(
+  id   SERIAL  NOT NULL,
+  type INTEGER NOT NULL,
+  PRIMARY KEY (id),
+  FOREIGN KEY (type) REFERENCES article_types
+);
+
 CREATE TABLE article_aliases(
   alias   VARCHAR NOT NULL,
   article INTEGER NOT NULL,
@@ -66,11 +75,13 @@ CREATE TABLE article_revisions(
   title     VARCHAR   NOT NULL,
   content   VARCHAR   NOT NULL,
   author    INTEGER,
-  format    varchar   NOT NULL,
+  format    VARCHAR   NOT NULL,
+  status    VARCHAR   NOT NULL,
   PRIMARY KEY (id),
   FOREIGN KEY (article) REFERENCES articles,
   FOREIGN KEY (author)  REFERENCES users,
-  CHECK (format IN ('html'))
+  CHECK (format IN ('html')),
+  CHECK (status IN ('draft', 'published', 'syndicated'))
 );
 
 CREATE TABLE article_revision_characteristics(
-- 
cgit v1.2.3

