Page MenuHomePhabricator

D5658.id.diff
No OneTemporary

D5658.id.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
@@ -74,6 +74,21 @@
);
},
],
+ [
+ 9,
+ async () => {
+ await dbQuery(
+ SQL`
+ ALTER TABLE messages
+ ADD COLUMN IF NOT EXISTS target_message bigint(20) DEFAULT NULL;
+
+ ALTER TABLE messages
+ ADD INDEX target_message (target_message);
+ `,
+ { multipleStatements: true },
+ );
+ },
+ ],
]);
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
@@ -88,7 +88,8 @@
type tinyint(3) UNSIGNED NOT NULL,
content mediumtext COLLATE utf8mb4_bin,
time bigint(20) NOT NULL,
- creation varchar(255) COLLATE utf8mb4_bin DEFAULT NULL
+ creation varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
+ target_message bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE notifications (
@@ -263,7 +264,8 @@
ALTER TABLE messages
ADD PRIMARY KEY (id),
ADD UNIQUE KEY user_creation (user,creation),
- ADD KEY thread (thread);
+ ADD KEY thread (thread),
+ ADD INDEX target_message (target_message);
ALTER TABLE notifications
ADD PRIMARY KEY (id),

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 29, 11:29 AM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2200218
Default Alt Text
D5658.id.diff (1 KB)

Event Timeline