mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-27 17:38:11 +03:00
tierlist migration
This commit is contained in:
Generated
+3
-3
@@ -62,7 +62,7 @@ dependencies:
|
||||
express-async-errors: 3.1.1_express@4.17.1
|
||||
express-session: 1.17.1
|
||||
fast-json-stable-hash: 1.0.1
|
||||
kamaitachi-common: github.com/zkldi/Kamaitachi-common/a502f7a1516945958a4f7081340ff667c77f57a5
|
||||
kamaitachi-common: github.com/zkldi/Kamaitachi-common/e7a539900ee048b264de96fab373b03c571bd411
|
||||
mongodb: 3.6.6
|
||||
monk: 7.3.4
|
||||
multer: 1.4.2
|
||||
@@ -4638,8 +4638,8 @@ packages:
|
||||
'@types/yoga-layout': 1.9.2
|
||||
dev: true
|
||||
|
||||
github.com/zkldi/Kamaitachi-common/a502f7a1516945958a4f7081340ff667c77f57a5:
|
||||
resolution: {tarball: https://codeload.github.com/zkldi/Kamaitachi-common/tar.gz/a502f7a1516945958a4f7081340ff667c77f57a5}
|
||||
github.com/zkldi/Kamaitachi-common/e7a539900ee048b264de96fab373b03c571bd411:
|
||||
resolution: {tarball: https://codeload.github.com/zkldi/Kamaitachi-common/tar.gz/e7a539900ee048b264de96fab373b03c571bd411}
|
||||
name: kamaitachi-common
|
||||
version: 0.1.0
|
||||
dependencies:
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { TierlistParent, Game } from "kamaitachi-common";
|
||||
import { gameHuman, validPlaytypes } from "kamaitachi-common/js/config";
|
||||
import db from "../../src/db/db";
|
||||
import MigrateRecords from "./migrate";
|
||||
|
||||
function ConvertFn(c: any): TierlistParent {
|
||||
const tierlistParent: TierlistParent = {
|
||||
createdAt: Date.now(),
|
||||
tierlistID: c.tierlistID,
|
||||
createdBy: 1,
|
||||
description: `The official Kamaitachi Tierlist for ${gameHuman[c.game as Game]}${
|
||||
validPlaytypes[c.game as Game].length > 1 ? ` (${c.playtype})` : ""
|
||||
}.`,
|
||||
game: c.game,
|
||||
playtype: c.playtype,
|
||||
isDefault: true,
|
||||
name: c.title,
|
||||
lastUpdated: Date.now(),
|
||||
permissions: {
|
||||
anyPlayer: {
|
||||
edit: 0,
|
||||
submit: 1,
|
||||
vote: 1,
|
||||
},
|
||||
},
|
||||
config: {
|
||||
autoHumanise: false,
|
||||
flags: ["Individual Difference"],
|
||||
requireState: "clear",
|
||||
},
|
||||
};
|
||||
|
||||
return tierlistParent;
|
||||
}
|
||||
|
||||
(async () => {
|
||||
await MigrateRecords(db.tierlists, "tierlist", ConvertFn);
|
||||
|
||||
process.exit(0);
|
||||
})();
|
||||
+4
-2
@@ -5,7 +5,8 @@ import {
|
||||
GoalDocument,
|
||||
IIDXBPIData,
|
||||
IIDXEamusementScoreDocument,
|
||||
KTBlackImportDocument,
|
||||
ImportDocument,
|
||||
TierlistParent,
|
||||
InviteCodeDocument,
|
||||
MilestoneDocument,
|
||||
NotificationDocument,
|
||||
@@ -94,6 +95,7 @@ const db = {
|
||||
songs,
|
||||
charts,
|
||||
scores: monkDB.get<ScoreDocument>("scores"),
|
||||
tierlists: monkDB.get<TierlistParent>("tierlists"),
|
||||
"score-pbs": monkDB.get<PBScoreDocument>("score-pbs"),
|
||||
folders: monkDB.get<FolderDocument>("folders"),
|
||||
"folder-chart-lookup": monkDB.get<FolderChartLookup>("folder-chart-lookup"),
|
||||
@@ -102,7 +104,7 @@ const db = {
|
||||
milestones: monkDB.get<MilestoneDocument>("milestones"),
|
||||
"user-milestones": monkDB.get<UserMilestoneDocument>("user-milestones"),
|
||||
users: monkDB.get<PrivateUserDocument>("users"),
|
||||
imports: monkDB.get<KTBlackImportDocument>("imports"),
|
||||
imports: monkDB.get<ImportDocument>("imports"),
|
||||
notifications: monkDB.get<NotificationDocument>("notifications"),
|
||||
sessions: monkDB.get<SessionDocument>("sessions"),
|
||||
"iidx-bpi-data": monkDB.get<IIDXBPIData>("iidx-bpi-data"),
|
||||
|
||||
Reference in New Issue
Block a user