Page MenuHomePhabricator

D8512.diff
No OneTemporary

D8512.diff

diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js
--- a/keyserver/src/database/migration-config.js
+++ b/keyserver/src/database/migration-config.js
@@ -479,6 +479,17 @@
`,
),
],
+ [
+ 41,
+ () =>
+ dbQuery(
+ SQL`
+ ALTER TABLE memberships
+ DROP INDEX user,
+ ADD KEY user_role_thread (user, role, thread)
+ `,
+ ),
+ ],
]);
const newDatabaseVersion: number = Math.max(...migrations.keys());
diff --git a/keyserver/src/database/setup-db.js b/keyserver/src/database/setup-db.js
--- a/keyserver/src/database/setup-db.js
+++ b/keyserver/src/database/setup-db.js
@@ -308,10 +308,9 @@
ADD PRIMARY KEY (id);
ALTER TABLE memberships
- ADD UNIQUE KEY thread_user (thread,user) USING BTREE,
- ADD KEY role (role) USING BTREE;
-
- ALTER TABLE memberships ADD INDEX user (user);
+ ADD UNIQUE KEY thread_user (thread, user) USING BTREE,
+ ADD KEY role (role) USING BTREE,
+ ADD KEY user_role_thread (user, role, thread);
ALTER TABLE messages
ADD PRIMARY KEY (id),

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 8:26 AM (15 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694134
Default Alt Text
D8512.diff (1 KB)

Event Timeline