aboutsummaryrefslogtreecommitdiff
path: root/src/odbc/mysql.sql
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2009-08-07 08:26:47 +0000
committerChristophe Romain <christophe.romain@process-one.net>2009-08-07 08:26:47 +0000
commit5598d3447854308f29ace5a021cb7712ef61ceb7 (patch)
tree73f1af4e59a1ae80a11b3cc188b2dc007b7ae730 /src/odbc/mysql.sql
parentDocument options for Roster Versioning (EJAB-964) (diff)
initial merge of pubsub odbc, compilation pass ok
SVN Revision: 2437
Diffstat (limited to '')
-rw-r--r--src/odbc/mysql.sql55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/odbc/mysql.sql b/src/odbc/mysql.sql
index dfbf69437..be182bf5f 100644
--- a/src/odbc/mysql.sql
+++ b/src/odbc/mysql.sql
@@ -158,3 +158,58 @@ CREATE TABLE roster_version (
-- ALTER TABLE rosterusers ADD COLUMN askmessage text AFTER ask;
-- UPDATE rosterusers SET askmessage = '';
-- ALTER TABLE rosterusers ALTER COLUMN askmessage SET NOT NULL;
+
+CREATE TABLE pubsub_node (
+ host text,
+ node text,
+ parent text,
+ type text,
+ nodeid bigint auto_increment primary key
+) CHARACTER SET utf8;
+CREATE INDEX i_pubsub_node_parent ON pubsub_node(parent(120));
+CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node(host(20), node(120));
+
+CREATE TABLE pubsub_node_option (
+ nodeid bigint,
+ name text,
+ val text
+) CHARACTER SET utf8;
+CREATE INDEX i_pubsub_node_option_nodeid ON pubsub_node_option(nodeid);
+ALTER TABLE `pubsub_node_option` ADD FOREIGN KEY (`nodeid`) REFERENCES `ejabberd`.`pubsub_node` (`nodeid`) ON DELETE CASCADE;
+
+CREATE TABLE pubsub_node_owner (
+ nodeid bigint,
+ owner text
+) CHARACTER SET utf8;
+CREATE INDEX i_pubsub_node_owner_nodeid ON pubsub_node_owner(nodeid);
+ALTER TABLE `pubsub_node_owner` ADD FOREIGN KEY (`nodeid`) REFERENCES `ejabberd`.`pubsub_node` (`nodeid`) ON DELETE CASCADE;
+
+CREATE TABLE pubsub_state (
+ nodeid bigint,
+ jid text,
+ affiliation character(1),
+ subscription character(1),
+ stateid bigint auto_increment primary key
+) CHARACTER SET utf8;
+CREATE INDEX i_pubsub_state_jid ON pubsub_state(jid(60));
+CREATE UNIQUE INDEX i_pubsub_state_tuple ON pubsub_state(nodeid, jid(60));
+ALTER TABLE `pubsub_state` ADD FOREIGN KEY (`nodeid`) REFERENCES `ejabberd`.`pubsub_node` (`nodeid`) ON DELETE CASCADE;
+
+CREATE TABLE pubsub_item (
+ nodeid bigint,
+ itemid text,
+ publisher text,
+ creation text,
+ modification text,
+ payload text
+) CHARACTER SET utf8;
+CREATE INDEX i_pubsub_item_itemid ON pubsub_item(itemid(36));
+CREATE UNIQUE INDEX i_pubsub_item_tuple ON pubsub_item(nodeid, itemid(36));
+ALTER TABLE `pubsub_item` ADD FOREIGN KEY (`nodeid`) REFERENCES `ejabberd`.`pubsub_node` (`nodeid`) ON DELETE CASCADE;
+
+CREATE TABLE pubsub_subscription_opt (
+ subid text,
+ opt_name varchar(32),
+ opt_value text
+);
+CREATE UNIQUE INDEX i_pubsub_subscription_opt ON pubsub_subscription_opt(subid(32), opt_name(32));