diff db/pubsub.sql @ 301:05c875a13a62

categories are now stored in a dedicated table if item contain an atom entry: - database creation/update files include the new table - item data are now stored in a ItemData namedtuple
author Goffi <goffi@goffi.org>
date Wed, 25 Nov 2015 18:33:38 +0100
parents bed30cef11a8
children 98409ef42c94
line wrap: on
line diff
--- a/db/pubsub.sql	Wed Nov 25 16:00:08 2015 +0100
+++ b/db/pubsub.sql	Wed Nov 25 18:33:38 2015 +0100
@@ -73,6 +73,13 @@
     UNIQUE (item_id,groupname)
 );
 
+CREATE TABLE item_categories (
+    item_categories_id serial PRIMARY KEY,
+    item_id integer NOT NULL references items ON DELETE CASCADE,
+    category text NOT NULL,
+    UNIQUE (item_id,category)
+);
+
 CREATE TABLE metadata (
 	key text PRIMARY KEY,
 	value text