Page MenuHomePhabricator

D8512.id28736.diff
No OneTemporary

D8512.id28736.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
@@ -16,7 +16,7 @@
const botViewer = createScriptViewer(bots.commbot.userID);
-const migrations: $ReadOnlyMap<number, () => Promise<void>> = new Map([
+const migrations: $ReadOnlyMap<number, () => Promise<mixed>> = new Map([
[
0,
async () => {
@@ -466,6 +466,17 @@
}
},
],
+ [
+ 39,
+ () =>
+ 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
@@ -306,10 +306,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, 1:35 PM (19 h, 5 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694796
Default Alt Text
D8512.id28736.diff (1 KB)

Event Timeline