Page MenuHomePhabricator

D4155.id13222.diff
No OneTemporary

D4155.id13222.diff

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
@@ -26,6 +26,7 @@
},
],
]);
+const newDatabaseVersion: number = Math.max(...migrations.keys());
async function makeSureBaseRoutePathExists(filePath: string): Promise<void> {
let readFile, json;
@@ -82,4 +83,4 @@
await writeFile.close();
}
-export { migrations };
+export { migrations, newDatabaseVersion };
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
@@ -10,12 +10,15 @@
import { createThread } from '../creators/thread-creator';
import { dbQuery, SQL } from '../database/database';
+import { updateDBVersion } from '../database/db-version';
+import { newDatabaseVersion } from '../database/migration-config';
import { createScriptViewer } from '../session/scripts';
async function setupDB() {
await createTables();
await createUsers();
await createThreads();
+ await setUpMetadataTable();
}
async function createTables() {
@@ -397,4 +400,8 @@
);
}
+async function setUpMetadataTable() {
+ await updateDBVersion(newDatabaseVersion);
+}
+
export { setupDB };

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 2:21 PM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2498052
Default Alt Text
D4155.id13222.diff (1 KB)

Event Timeline