Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2834459
D5658.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5658.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5658: [keyserver] added target_message to messages table
Attached
Detach File
Event Timeline
Log In to Comment