diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-03-03 17:34:57 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-03-03 17:34:57 +0100 |
commit | fc11f0949190dfbc8da1585a072027a2894130a7 (patch) | |
tree | f682e7fa6f9337fe6860ccfef9da0891b4afc6cf | |
parent | 291fd5e319005b8908c9516923bd1384845e85f0 (diff) |
Support article categories.
-rw-r--r-- | schema.sql | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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, |