Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32215064
D6924.1765157669.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6924.1765157669.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
@@ -216,6 +216,17 @@
`);
},
],
+ [
+ 21,
+ async () => {
+ await dbQuery(SQL`
+ ALTER TABLE messages
+ ADD COLUMN IF NOT EXISTS pinned tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
+ ADD COLUMN IF NOT EXISTS pin_time bigint(20) DEFAULT NULL,
+ ADD INDEX IF NOT EXISTS thread_pinned (thread, pinned);
+ `);
+ },
+ ],
]);
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
@@ -89,7 +89,9 @@
content mediumtext COLLATE utf8mb4_bin,
time bigint(20) NOT NULL,
creation varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
- target_message bigint(20) DEFAULT NULL
+ target_message bigint(20) DEFAULT NULL,
+ pinned tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
+ pin_time bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE notifications (
@@ -279,7 +281,8 @@
ADD PRIMARY KEY (id),
ADD UNIQUE KEY user_creation (user,creation),
ADD KEY thread (thread),
- ADD INDEX target_message (target_message);
+ ADD INDEX target_message (target_message),
+ ADD INDEX thread_pinned (thread, pinned);
ALTER TABLE notifications
ADD PRIMARY KEY (id),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 8, 1:34 AM (17 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5846736
Default Alt Text
D6924.1765157669.diff (1 KB)
Attached To
Mode
D6924: [keyserver] Introduce columns in messages table to support pinned messages
Attached
Detach File
Event Timeline
Log In to Comment