summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-03 17:34:57 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-03 17:34:57 +0100
commitfc11f0949190dfbc8da1585a072027a2894130a7 (patch)
treef682e7fa6f9337fe6860ccfef9da0891b4afc6cf
parent291fd5e319005b8908c9516923bd1384845e85f0 (diff)
Support article categories.
-rw-r--r--schema.sql21
1 files changed, 21 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
index 5e4c250..8f00df6 100644
--- a/schema.sql
+++ b/schema.sql
@@ -127,6 +127,27 @@ CREATE TABLE comment_revisions(
CHECK (format IN ('text'))
);
+CREATE TABLE categories(
+ id SERIAL NOT NULL,
+ name VARCHAR NOT NULL,
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE category_inclusions(
+ category INTEGER NOT NULL,
+ supercategory INTEGER NOT NULL,
+ PRIMARY KEY (category, supercategory),
+ FOREIGN KEY (category) REFERENCES categories,
+ FOREIGN KEY (supercategory) REFERENCES categories
+);
+
+CREATE TABLE article_category_memberships(
+ article INTEGER NOT NULL,
+ category VARCHAR NOT NULL,
+ PRIMARY KEY (article, category),
+ FOREIGN KEY (article) REFERENCES articles
+);
+
CREATE TABLE user_permissions(
"user" INTEGER NOT NULL,
permission VARCHAR NOT NULL,