Course support

This commit is contained in:
zkldi
2021-05-27 12:50:25 +01:00
parent 5864ab07d0
commit 0a817f6ea0
5 changed files with 126 additions and 4 deletions
@@ -0,0 +1,10 @@
import fs from "fs";
import path from "path";
import db from "../../../src/external/mongo/db";
(async () => {
const data = JSON.parse(fs.readFileSync(path.join(__dirname, "courses.json"), "utf-8"));
await db["bms-course-lookup"].insert(data);
})();
+3
View File
@@ -82,6 +82,9 @@ const staticIndexes: Partial<Record<ValidDatabases, Index[]>> = {
),
index({ "data.hashSHA256": 1 }),
],
"bms-course-lookup": [index({ md5sums: 1 }, UNIQUE)],
"beatoraja-auth-tokens": [index({ token: 1 }, UNIQUE)],
"usc-auth-tokens": [index({ token: 1 }, UNIQUE)],
};
const indexes: Partial<Record<ValidDatabases, Index[]>> = staticIndexes;