diff db/sat_pubsub_update_0_1.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 df1edebb0466
children 3c2705199108
line wrap: on
line diff
--- a/db/sat_pubsub_update_0_1.sql	Wed Nov 25 16:00:08 2015 +0100
+++ b/db/sat_pubsub_update_0_1.sql	Wed Nov 25 18:33:38 2015 +0100
@@ -12,6 +12,13 @@
 
 INSERT INTO metadata VALUES ('version', '1');
 
+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)
+);
+
 UPDATE nodes SET node='urn:xmpp:microblog:0', pep=substring(node from 20) WHERE node LIKE 'urn:xmpp:groupblog:_%';
 
 /* This is to update namespaces, SàT was bugguy before 0.6 and didn't set the atom namespace in <entry/> */