-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i'm ill as fuck man
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |