Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3249346
D4154.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
885 B
Referenced Files
None
Subscribers
None
D4154.diff
View Options
diff --git a/keyserver/src/database/db-version.js b/keyserver/src/database/db-version.js
--- a/keyserver/src/database/db-version.js
+++ b/keyserver/src/database/db-version.js
@@ -4,11 +4,13 @@
import { dbQuery, SQL } from './database';
+const dbVersionMetadataKey = 'db_version';
+
async function fetchDBVersion(): Promise<number> {
const versionQuery = SQL`
SELECT data
FROM metadata
- WHERE name = 'db_version';
+ WHERE name = ${dbVersionMetadataKey};
`;
const [[versionResult]] = await dbQuery(versionQuery);
if (!versionResult) {
@@ -20,7 +22,7 @@
async function updateDBVersion(dbVersion: number): Promise<QueryResults> {
const updateQuery = SQL`
INSERT INTO metadata (name, data)
- VALUES ('db_version', ${dbVersion})
+ VALUES (${dbVersionMetadataKey}, ${dbVersion})
ON DUPLICATE KEY
UPDATE
data = ${dbVersion};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 1:47 PM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2498013
Default Alt Text
D4154.diff (885 B)
Attached To
Mode
D4154: [keyserver] Extract "db_version" metadata key
Attached
Detach File
Event Timeline
Log In to Comment