mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 23:27:55 -05:00
Wipe placements before adding new ones from source
This commit is contained in:
@@ -33,6 +33,7 @@ void main();
|
||||
async function main() {
|
||||
const placements: Placements = [];
|
||||
|
||||
wipeMonthYearPlacements(resolveMonthYear(jsonNumber));
|
||||
for (const mode of modes) {
|
||||
for (const region of regions) {
|
||||
for (const includeWeapon of [false]) {
|
||||
@@ -180,3 +181,19 @@ function addPlacements(placements: Placements) {
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
function wipeMonthYearPlacements({
|
||||
month,
|
||||
year,
|
||||
}: {
|
||||
month: number;
|
||||
year: number;
|
||||
}) {
|
||||
const wipeMonthYearPlacementsStm = sql.prepare(/* sql */ `
|
||||
delete from "XRankPlacement"
|
||||
where "month" = @month
|
||||
and "year" = @year
|
||||
`);
|
||||
|
||||
wipeMonthYearPlacementsStm.run({ month, year });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user