From 573113dfb99e4d6eb6086b53dee1afcb845c18a9 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 18 Aug 2012 17:39:46 +0200 Subject: Add table posts. --- schema.sql | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'schema.sql') diff --git a/schema.sql b/schema.sql index ae843f8..c555166 100644 --- a/schema.sql +++ b/schema.sql @@ -117,10 +117,15 @@ CREATE TABLE wiki_page_revisions( ); -CREATE TABLE bookmarks( +CREATE TABLE posts( id SERIAL NOT NULL, owner INTEGER, date TIMESTAMP WITH TIME ZONE DEFAULT now(), + PRIMARY KEY(id), + FOREIGN KEY(owner) REFERENCES users +); + +CREATE TABLE bookmarks INHERITS posts ( uri VARCHAR NOT NULL, title VARCHAR, description VARCHAR, @@ -137,11 +142,7 @@ CREATE TABLE bookmark_tags( FOREIGN KEY(bookmark) REFERENCES bookmarks ); - -CREATE TABLE lazychat_messages( - id SERIAL NOT NULL, - author INTEGER, - date TIMESTAMP WITH TIME ZONE DEFAULT now(), +CREATE TABLE lazychat_messages INHERITS posts ( content VARCHAR, format VARCHAR NOT NULL, PRIMARY KEY(id), -- cgit v1.2.3