summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/lite.new.sql17
-rw-r--r--sql/lite.sql16
-rw-r--r--sql/mysql.new.sql16
-rw-r--r--sql/mysql.sql15
-rw-r--r--sql/pg.new.sql17
-rw-r--r--sql/pg.sql16
6 files changed, 97 insertions, 0 deletions
diff --git a/sql/lite.new.sql b/sql/lite.new.sql
index ab229c6b..7264e58c 100644
--- a/sql/lite.new.sql
+++ b/sql/lite.new.sql
@@ -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);
diff --git a/sql/lite.sql b/sql/lite.sql
index 8f128c33..e8755029 100644
--- a/sql/lite.sql
+++ b/sql/lite.sql
@@ -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);
diff --git a/sql/mysql.new.sql b/sql/mysql.new.sql
index 39df58c5..a10e21d9 100644
--- a/sql/mysql.new.sql
+++ b/sql/mysql.new.sql
@@ -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)
+);
diff --git a/sql/mysql.sql b/sql/mysql.sql
index 0e3c826e..a05f8c86 100644
--- a/sql/mysql.sql
+++ b/sql/mysql.sql
@@ -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))
+);
diff --git a/sql/pg.new.sql b/sql/pg.new.sql
index 49544114..c585fd30 100644
--- a/sql/pg.new.sql
+++ b/sql/pg.new.sql
@@ -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);
diff --git a/sql/pg.sql b/sql/pg.sql
index 250a22d2..eae98d3f 100644
--- a/sql/pg.sql
+++ b/sql/pg.sql
@@ -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);