diff --git a/Justfile b/Justfile index 2aaf2e3db..d516d0b43 100644 --- a/Justfile +++ b/Justfile @@ -7,10 +7,13 @@ mod docs interactive: -@just --choose +install: + pnpm install + # Run the frontend and backend for Tachi. # # This is the main command you want to use to start up tachi. Go for it! -start: +start: install parallel --lb ::: 'FORCE_COLOR=1 just server start' 'FORCE_COLOR=1 just client start' # test everything diff --git a/server/src/lib/migration/migrations.ts b/server/src/lib/migration/migrations.ts index f2b8e572b..b3b12d1c4 100644 --- a/server/src/lib/migration/migrations.ts +++ b/server/src/lib/migration/migrations.ts @@ -9,6 +9,7 @@ import KtRatingToCuratorSkill from "./migrations/ktRating-to-curator-skill"; import MarkFervidexAsWithoutIntent from "./migrations/mark-fervidex-as-without-intent"; import MarkKsHookAsWithoutIntent from "./migrations/mark-kshook-as-without-intent"; import NullLR2HookFailedBPs from "./migrations/null-lr2hook-failed-bps"; +import RemoveAbove100pc from "./migrations/remove-above-100pc"; import RemoveIIDXBeginners from "./migrations/remove-iidx-beginners"; import RemoveIIDX2dxtraBeginners from "./migrations/remove-iidx-extra-beginners"; import RemoveMultifolderStats from "./migrations/remove-multifolder-stats"; @@ -74,7 +75,12 @@ if (Environment.nodeEnv !== "test") { // bokutachi specific migrations if (TachiConfig.TYPE !== "kamai") { - REGISTERED_MIGRATIONS.push(NullLR2HookFailedBPs, FixUndefinedBMSData, RemoveRandom); + REGISTERED_MIGRATIONS.push( + NullLR2HookFailedBPs, + FixUndefinedBMSData, + RemoveRandom, + RemoveAbove100pc + ); } } diff --git a/server/src/lib/migration/migrations/remove-above-100pc.ts b/server/src/lib/migration/migrations/remove-above-100pc.ts new file mode 100644 index 000000000..a0a0c7654 --- /dev/null +++ b/server/src/lib/migration/migrations/remove-above-100pc.ts @@ -0,0 +1,20 @@ +import db from "external/mongo/db"; +import { DeleteMultipleScores } from "lib/score-mutation/delete-scores"; +import type { Migration } from "utils/types"; + +const migration: Migration = { + id: "remove-above-100pc", + up: async () => { + const toDelete = await db.scores.find({ + game: "bms", + "scoreData.percent": { $gt: 100.0 }, + }); + + await DeleteMultipleScores(toDelete); + }, + down: () => { + throw new Error(`Reverting this change is not possible.`); + }, +}; + +export default migration;