mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-11 13:46:10 -05:00
Delete unused table
This commit is contained in:
@@ -644,19 +644,6 @@ export interface TournamentStage {
|
||||
createdAt: Generated<number>;
|
||||
}
|
||||
|
||||
/** Tournament sub post, shown in a list of subs available for teams to pick from. */
|
||||
export interface TournamentSub {
|
||||
bestWeapons: JSONColumnType<MainWeaponId[]>;
|
||||
/** 0 = no, 1 = yes, 2 = listen only */
|
||||
canVc: number;
|
||||
createdAt: Generated<number>;
|
||||
message: string | null;
|
||||
okWeapons: JSONColumnTypeNullable<MainWeaponId[]>;
|
||||
tournamentId: number;
|
||||
userId: number;
|
||||
visibility: "+1" | "+2" | "+3" | "ALL";
|
||||
}
|
||||
|
||||
export interface TournamentLFGLike {
|
||||
likerTeamId: number;
|
||||
targetTeamId: number;
|
||||
@@ -1279,7 +1266,6 @@ export interface DB {
|
||||
TournamentResult: TournamentResult;
|
||||
TournamentRound: TournamentRound;
|
||||
TournamentStage: TournamentStage;
|
||||
TournamentSub: TournamentSub;
|
||||
TournamentTeam: TournamentTeam;
|
||||
TournamentTeamCheckIn: TournamentTeamCheckIn;
|
||||
TournamentTeamMember: TournamentTeamMember;
|
||||
|
||||
BIN
db-test.sqlite3
BIN
db-test.sqlite3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7
migrations/164-drop-tournament-sub.js
Normal file
7
migrations/164-drop-tournament-sub.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export function up(db) {
|
||||
db.transaction(() => {
|
||||
db.prepare(/* sql */ `drop table if exists "TournamentSub"`).run();
|
||||
|
||||
db.pragma("foreign_key_check");
|
||||
})();
|
||||
}
|
||||
@@ -674,9 +674,9 @@ export function buildCases(fx: Fixtures): {
|
||||
);
|
||||
add(
|
||||
"TournamentLFGRepository.findAllSubsByTournamentId",
|
||||
fx.subsTournamentId,
|
||||
(tournamentId) =>
|
||||
TournamentLFGRepository.findAllSubsByTournamentId(tournamentId),
|
||||
fx.lfgTournament,
|
||||
(lfg) =>
|
||||
TournamentLFGRepository.findAllSubsByTournamentId(lfg.tournamentId),
|
||||
);
|
||||
|
||||
// TournamentMatchRepository
|
||||
|
||||
@@ -75,7 +75,6 @@ export interface Fixtures {
|
||||
} | null;
|
||||
lfgAuthorId: number | null;
|
||||
lfgTournament: { tournamentId: number; teamId: number } | null;
|
||||
subsTournamentId: number | null;
|
||||
auditTournamentId: number | null;
|
||||
xrank: {
|
||||
userId: number;
|
||||
@@ -154,7 +153,6 @@ export async function resolveFixtures(): Promise<Fixtures> {
|
||||
heavyAssociation: await resolveHeavyAssociation(),
|
||||
lfgAuthorId: await resolveLfgAuthorId(),
|
||||
lfgTournament: await resolveLfgTournament(),
|
||||
subsTournamentId: (await resolveSubsTournamentId()) ?? heavyTournamentId,
|
||||
auditTournamentId: (await resolveAuditTournamentId()) ?? heavyTournamentId,
|
||||
xrank: await resolveXRank(),
|
||||
heavyArtUserId: await resolveHeavyArtUserId(),
|
||||
@@ -934,18 +932,6 @@ async function resolveLfgTournament() {
|
||||
return { tournamentId: row.tournamentId, teamId: row.id };
|
||||
}
|
||||
|
||||
async function resolveSubsTournamentId() {
|
||||
const row = await db
|
||||
.selectFrom("TournamentSub")
|
||||
.select(({ fn }) => ["tournamentId", fn.countAll<number>().as("count")])
|
||||
.groupBy("tournamentId")
|
||||
.orderBy("count", "desc")
|
||||
.limit(1)
|
||||
.executeTakeFirst();
|
||||
|
||||
return row?.tournamentId ?? null;
|
||||
}
|
||||
|
||||
async function resolveAuditTournamentId() {
|
||||
const row = await db
|
||||
.selectFrom("TournamentAuditLog")
|
||||
|
||||
Reference in New Issue
Block a user