sendou.ink/scripts/fix-map-pools.ts
2023-05-16 22:23:34 +03:00

17 lines
511 B
TypeScript

/* 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(", ")}`);