Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32174898
D8432.1765066397.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
913 B
Referenced Files
None
Subscribers
None
D8432.1765066397.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
@@ -490,6 +490,15 @@
`,
),
],
+ [
+ 42,
+ async () => {
+ await dbQuery(SQL`
+ ALTER TABLE roles
+ ADD UNIQUE KEY thread_name (thread, name);
+ `);
+ },
+ ],
]);
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
@@ -340,7 +340,8 @@
ALTER TABLE roles
ADD PRIMARY KEY (id),
- ADD KEY thread (thread);
+ ADD KEY thread (thread),
+ ADD UNIQUE KEY thread_name (thread, name);
ALTER TABLE sessions
ADD PRIMARY KEY (id),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 12:13 AM (10 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5841538
Default Alt Text
D8432.1765066397.diff (913 B)
Attached To
Mode
D8432: [keyserver] Add unique key on thread_name in the roles table
Attached
Detach File
Event Timeline
Log In to Comment