mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-08 12:16:12 -05:00
Add fix map pools script
This commit is contained in:
16
scripts/fix-map-pools.ts
Normal file
16
scripts/fix-map-pools.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/* eslint-disable no-console */
|
||||
import "dotenv/config";
|
||||
import { sql } from "~/db/sql";
|
||||
|
||||
const faultyTournamentTeamIds = sql
|
||||
.prepare(
|
||||
"select tournamentTeamId from mappoolmap where tournamentteamid is not null and mode != 'SZ' group by tournamentteamid"
|
||||
)
|
||||
.all()
|
||||
.map((row) => row.tournamentTeamId);
|
||||
|
||||
for (const id of faultyTournamentTeamIds) {
|
||||
sql.prepare("delete from mappoolmap where tournamentteamid = ?").run(id);
|
||||
}
|
||||
|
||||
console.log(`Nuked the following: ${faultyTournamentTeamIds.join(", ")}`);
|
||||
Reference in New Issue
Block a user