From 95fa43aa96514b7e8b77fa7c29d2c0b5b1c1331a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= <pchmielowski@process-one.net>
Date: Tue, 18 May 2021 18:29:32 +0200
Subject: Add missing indexes to sql sr_group tables

---
 sql/mysql.new.sql | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'sql/mysql.new.sql')

diff --git a/sql/mysql.new.sql b/sql/mysql.new.sql
index b29a003eb..ed4f93348 100644
--- a/sql/mysql.new.sql
+++ b/sql/mysql.new.sql
@@ -76,6 +76,8 @@ CREATE TABLE sr_group (
     PRIMARY KEY (server_host(191), name)
 ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
 
+CREATE UNIQUE INDEX i_sr_group_sh_name ON sr_group(server_host(191), name);
+
 CREATE TABLE sr_user (
     jid varchar(191) NOT NULL,
     server_host varchar(191) NOT NULL,
@@ -84,6 +86,7 @@ CREATE TABLE sr_user (
     PRIMARY KEY (server_host(191), jid, grp)
 ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
 
+CREATE UNIQUE INDEX i_sr_user_sh_jid_group ON sr_group(server_host(191), jid, grp);
 CREATE INDEX i_sr_user_sh_jid ON sr_user(server_host(191), jid);
 CREATE INDEX i_sr_user_sh_grp ON sr_user(server_host(191), grp);
 
-- 
cgit v1.2.3

