diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2018-05-27 08:46:29 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2018-05-27 09:20:24 +0200 |
commit | dd0cece91f3b5b083ea910650d7b40d44d887921 (patch) | |
tree | 5173058c62aa2dc4658636fdac6eebb726468708 /schema.sql | |
parent | 567f3ebbe6f60a872a57489516855b113315e341 (diff) |
Add support for explicit journal keeping in the database.
Diffstat (limited to 'schema.sql')
-rw-r--r-- | schema.sql | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -68,6 +68,22 @@ CREATE TABLE article_aliases( FOREIGN KEY (article) REFERENCES articles ); +CREATE TABLE journals( + id INTEGER NOT NULL, + path_prefix VARCHAR, --can be null to make the journal unreachable + PRIMARY KEY (id) +); + +CREATE TABLE journal_entries( + journal INTEGER NOT NULL, + index INTEGER NOT NULL, + article INTEGER NOT NULL, + PRIMARY KEY (journal, index), + FOREIGN KEY (article) REFERENCES articles, + FOREIGN KEY (journal) REFERENCES journals, + CHECK (index >= 0) +); + CREATE TABLE comments( id SERIAL NOT NULL, article INTEGER NOT NULL, |