Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3249393
D4155.id13222.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4155.id13222.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
@@ -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
Details
Attached
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)
Attached To
Mode
D4155: [keyserver] Initialize MySQL databases with the latest migration version
Attached
Detach File
Event Timeline
Log In to Comment