mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-26 05:12:19 -05:00
Remove vodder script
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
/* eslint-disable no-console */
|
||||
import "dotenv/config";
|
||||
import { sql } from "~/db/sql";
|
||||
|
||||
sql
|
||||
.prepare(
|
||||
`update "TournamentStage" set "name" = 'Main bracket' where "name" = 'Elimination stage'`,
|
||||
)
|
||||
.run();
|
||||
|
||||
console.log(`Fixed tournaments`);
|
||||
26
scripts/remove-vodder.ts
Normal file
26
scripts/remove-vodder.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/* eslint-disable no-console */
|
||||
import "dotenv/config";
|
||||
import invariant from "tiny-invariant";
|
||||
import { sql } from "~/db/sql";
|
||||
|
||||
const discordId = process.argv[2]?.trim();
|
||||
|
||||
invariant(discordId, "discord id is required (argument 1)");
|
||||
|
||||
const id = (
|
||||
sql
|
||||
.prepare(`select "id" from "User" where "discordId" = @discordId`)
|
||||
.get({ discordId }) as any
|
||||
)?.id;
|
||||
|
||||
invariant(id, "user not found");
|
||||
|
||||
sql
|
||||
.prepare(`update "User" set "isVideoAdder" = 0 where "id" = @id`)
|
||||
.run({ id });
|
||||
|
||||
sql
|
||||
.prepare(`delete from "UnvalidatedVideo" where "submitterUserId" = @id`)
|
||||
.run({ id });
|
||||
|
||||
console.log(`Removed vodder`);
|
||||
Reference in New Issue
Block a user