Page MenuHomePhabricator

D4154.diff
No OneTemporary

D4154.diff

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

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)

Event Timeline