aboutsummaryrefslogtreecommitdiff
path: root/sql/pg.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/pg.sql')
-rw-r--r--sql/pg.sql25
1 files changed, 24 insertions, 1 deletions
diff --git a/sql/pg.sql b/sql/pg.sql
index f761e68da..fd56ba39d 100644
--- a/sql/pg.sql
+++ b/sql/pg.sql
@@ -101,7 +101,7 @@ CREATE TABLE archive (
created_at TIMESTAMP NOT NULL DEFAULT now()
);
-CREATE INDEX i_username ON archive USING btree (username);
+CREATE INDEX i_username_timestamp ON archive USING btree (username, timestamp);
CREATE INDEX i_timestamp ON archive USING btree (timestamp);
CREATE INDEX i_peer ON archive USING btree (peer);
CREATE INDEX i_bare_peer ON archive USING btree (bare_peer);
@@ -308,6 +308,18 @@ CREATE TABLE muc_online_users (
CREATE UNIQUE INDEX i_muc_online_users ON muc_online_users USING btree (username, server, resource, name, host);
CREATE INDEX i_muc_online_users_us ON muc_online_users USING btree (username, server);
+CREATE TABLE muc_room_subscribers (
+ room text NOT NULL,
+ host text NOT NULL,
+ jid text NOT NULL,
+ nick text NOT NULL,
+ nodes text NOT NULL,
+ created_at TIMESTAMP NOT NULL DEFAULT now()
+);
+
+CREATE INDEX i_muc_room_subscribers_host_jid ON muc_room_subscribers USING btree (host, jid);
+CREATE UNIQUE INDEX i_muc_room_subscribers_host_room_jid ON muc_room_subscribers USING btree (host, room, jid);
+
CREATE TABLE irc_custom (
jid text NOT NULL,
host text NOT NULL,
@@ -395,3 +407,14 @@ CREATE TABLE proxy65 (
CREATE UNIQUE INDEX i_proxy65_sid ON proxy65 USING btree (sid);
CREATE INDEX i_proxy65_jid ON proxy65 USING btree (jid_i);
+
+CREATE TABLE push_session (
+ username text NOT NULL,
+ timestamp bigint NOT NULL,
+ service text NOT NULL,
+ node text NOT NULL,
+ xml text NOT NULL
+);
+
+CREATE UNIQUE INDEX i_push_usn ON push_session USING btree (username, service, node);
+CREATE UNIQUE INDEX i_push_ut ON push_session USING btree (username, timestamp);