]> granicus.if.org Git - ejabberd/commitdiff
Add SQL schemas for MQTT tables
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Wed, 27 Feb 2019 10:06:17 +0000 (13:06 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Wed, 27 Feb 2019 10:06:17 +0000 (13:06 +0300)
sql/lite.new.sql
sql/lite.sql
sql/mysql.new.sql
sql/mysql.sql
sql/pg.new.sql
sql/pg.sql

index ab229c6b11426fbdfa826d8fce1fdd6b456b8df4..7264e58cbea7b294890a5bd9db99f2f3c9ea85b6 100644 (file)
@@ -464,3 +464,20 @@ CREATE TABLE mix_pam (
 
 CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username, server_host, channel, service);
 CREATE INDEX i_mix_pam_us ON mix_pam (username, server_host);
+
+CREATE TABLE mqtt_pub (
+    username text NOT NULL,
+    server_host text NOT NULL,
+    resource text NOT NULL,
+    topic text NOT NULL,
+    qos smallint NOT NULL,
+    payload blob NOT NULL,
+    payload_format smallint NOT NULL,
+    content_type text NOT NULL,
+    response_topic text NOT NULL,
+    correlation_data blob NOT NULL,
+    user_properties blob NOT NULL,
+    expiry bigint NOT NULL
+);
+
+CREATE UNIQUE INDEX i_mqtt_topic_server ON mqtt_pub (topic, server_host);
index 8f128c33198d6b0508551f9c2bec6ec15aa584d1..e8755029c7b009729db2932f8ac861061be72581 100644 (file)
@@ -432,3 +432,19 @@ CREATE TABLE mix_pam (
 
 CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username, channel, service);
 CREATE INDEX i_mix_pam_us ON mix_pam (username);
+
+CREATE TABLE mqtt_pub (
+    username text NOT NULL,
+    resource text NOT NULL,
+    topic text NOT NULL,
+    qos smallint NOT NULL,
+    payload blob NOT NULL,
+    payload_format smallint NOT NULL,
+    content_type text NOT NULL,
+    response_topic text NOT NULL,
+    correlation_data blob NOT NULL,
+    user_properties blob NOT NULL,
+    expiry bigint NOT NULL
+);
+
+CREATE UNIQUE INDEX i_mqtt_topic ON mqtt_pub (topic);
index 39df58c552b4787d93b7c0b091f25fd537f8a59b..a10e21d9193ee951c608e4c3716c816de0225ebd 100644 (file)
@@ -480,3 +480,19 @@ CREATE TABLE mix_pam (
 
 CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username(191), server_host(191), channel(191), service(191));
 CREATE INDEX i_mix_pam_us ON mix_pam (username(191), server_host(191));
+
+CREATE TABLE mqtt_pub (
+    username varchar(191) NOT NULL,
+    server_host varchar(191) NOT NULL,
+    resource varchar(191) NOT NULL,
+    topic text NOT NULL,
+    qos tinyint NOT NULL,
+    payload blob NOT NULL,
+    payload_format tinyint NOT NULL,
+    content_type text NOT NULL,
+    response_topic text NOT NULL,
+    correlation_data blob NOT NULL,
+    user_properties blob NOT NULL,
+    expiry int unsigned NOT NULL,
+    UNIQUE KEY i_mqtt_topic_server (topic(191), server_host)
+);
index 0e3c826ef775be68fabfe453bc5c03ffb088881a..a05f8c86cacb59c32f6d8bd856514d2b4a835016 100644 (file)
@@ -448,3 +448,18 @@ CREATE TABLE mix_pam (
 
 CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username(191), channel(191), service(191));
 CREATE INDEX i_mix_pam_u ON mix_pam (username(191));
+
+CREATE TABLE mqtt_pub (
+    username varchar(191) NOT NULL,
+    resource varchar(191) NOT NULL,
+    topic text NOT NULL,
+    qos tinyint NOT NULL,
+    payload blob NOT NULL,
+    payload_format tinyint NOT NULL,
+    content_type text NOT NULL,
+    response_topic text NOT NULL,
+    correlation_data blob NOT NULL,
+    user_properties blob NOT NULL,
+    expiry int unsigned NOT NULL,
+    UNIQUE KEY i_mqtt_topic (topic(191))
+);
index 495441147c867f95558fefa0ac545c7737f70012..c585fd3074b39803b6e1646bab561715df399782 100644 (file)
@@ -625,3 +625,20 @@ CREATE TABLE mix_pam (
 
 CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username, server_host, channel, service);
 CREATE INDEX i_mix_pam_us ON mix_pam (username, server_host);
+
+CREATE TABLE mqtt_pub (
+    username text NOT NULL,
+    server_host text NOT NULL,
+    resource text NOT NULL,
+    topic text NOT NULL,
+    qos smallint NOT NULL,
+    payload bytea NOT NULL,
+    payload_format smallint NOT NULL,
+    content_type text NOT NULL,
+    response_topic text NOT NULL,
+    correlation_data bytea NOT NULL,
+    user_properties bytea NOT NULL,
+    expiry bigint NOT NULL
+);
+
+CREATE UNIQUE INDEX i_mqtt_topic_server ON mqtt_pub (topic, server_host);
index 250a22d2d6df04d1924522e9fddd5e21fa720032..eae98d3f0358e09a48ecc6e6192154d504e2c7c4 100644 (file)
@@ -452,3 +452,19 @@ CREATE TABLE mix_pam (
 
 CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username, channel, service);
 CREATE INDEX i_mix_pam_us ON mix_pam (username);
+
+CREATE TABLE mqtt_pub (
+    username text NOT NULL,
+    resource text NOT NULL,
+    topic text NOT NULL,
+    qos smallint NOT NULL,
+    payload bytea NOT NULL,
+    payload_format smallint NOT NULL,
+    content_type text NOT NULL,
+    response_topic text NOT NULL,
+    correlation_data bytea NOT NULL,
+    user_properties bytea NOT NULL,
+    expiry bigint NOT NULL
+);
+
+CREATE UNIQUE INDEX i_mqtt_topic ON mqtt_pub (topic);