mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Add SQL schemas for MQTT tables
This commit is contained in:
parent
456e87e8b2
commit
7511da0f26
@ -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);
|
||||
|
16
sql/lite.sql
16
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);
|
||||
|
@ -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)
|
||||
);
|
||||
|
@ -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))
|
||||
);
|
||||
|
@ -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);
|
||||
|
16
sql/pg.sql
16
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);
|
||||
|
Loading…
Reference in New Issue
Block a user