mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-13 21:59:58 -05:00
More consistent date columns
This commit is contained in:
@@ -1014,8 +1014,8 @@ export function buildCases(fx: Fixtures): {
|
||||
add("UserRepository.inGameNameByUserId", fx.heavyUser, (user) =>
|
||||
UserRepository.inGameNameByUserId(user.id),
|
||||
);
|
||||
add("UserRepository.patronSinceByUserId", fx.heavyUser, (user) =>
|
||||
UserRepository.patronSinceByUserId(user.id),
|
||||
add("UserRepository.patronStartedAtByUserId", fx.heavyUser, (user) =>
|
||||
UserRepository.patronStartedAtByUserId(user.id),
|
||||
);
|
||||
add("UserRepository.joinOrderByUserId", fx.heavyUser, (user) =>
|
||||
UserRepository.joinOrderByUserId(user.id),
|
||||
|
||||
@@ -644,9 +644,9 @@ async function resolveHeavyOrg() {
|
||||
"CalendarEventDate.eventId",
|
||||
"CalendarEvent.id",
|
||||
)
|
||||
.select(["CalendarEvent.name", "CalendarEventDate.startTime"])
|
||||
.select(["CalendarEvent.name", "CalendarEventDate.startsAt"])
|
||||
.where("CalendarEvent.organizationId", "=", orgRow.id)
|
||||
.orderBy("CalendarEventDate.startTime", "desc")
|
||||
.orderBy("CalendarEventDate.startsAt", "desc")
|
||||
.limit(1)
|
||||
.executeTakeFirst();
|
||||
if (!latestEvent) return null;
|
||||
|
||||
@@ -55,11 +55,11 @@ const tournaments = await db
|
||||
"Tournament.settings",
|
||||
"Tournament.isFinalized",
|
||||
"CalendarEvent.name",
|
||||
"CalendarEventDate.startTime",
|
||||
"CalendarEventDate.startsAt",
|
||||
])
|
||||
.where("CalendarEventDate.startTime", ">=", seasonStartTimestamp)
|
||||
.where("CalendarEventDate.startTime", "<=", seasonEndTimestamp)
|
||||
.orderBy("CalendarEventDate.startTime")
|
||||
.where("CalendarEventDate.startsAt", ">=", seasonStartTimestamp)
|
||||
.where("CalendarEventDate.startsAt", "<=", seasonEndTimestamp)
|
||||
.orderBy("CalendarEventDate.startsAt")
|
||||
.execute();
|
||||
|
||||
const unfinalizedTournaments = tournaments.filter(
|
||||
|
||||
@@ -75,7 +75,7 @@ async function main() {
|
||||
name: `${tournament.ctx.name} - ${div.startsWith("Division") ? div : `Division ${div}`}`,
|
||||
organizationId: tournament.ctx.organization?.id ?? null,
|
||||
rules: tournament.ctx.rules,
|
||||
startTimes: [dateToDatabaseTimestamp(tournament.ctx.startTime)],
|
||||
startTimes: [dateToDatabaseTimestamp(tournament.ctx.startsAt)],
|
||||
tags: null,
|
||||
tournamentToCopyId: tournament.ctx.id,
|
||||
avatarImgId: calendarEvent.avatarImgId ?? undefined,
|
||||
|
||||
@@ -78,8 +78,8 @@ async function getParticipantsForOrgInMonth(
|
||||
)
|
||||
.select(({ fn }) => fn.count<number>("tmgrp.userId").distinct().as("count"))
|
||||
.where("ce.organizationId", "=", organizationId)
|
||||
.where("ced.startTime", ">=", startTimestamp)
|
||||
.where("ced.startTime", "<", endTimestamp)
|
||||
.where("ced.startsAt", ">=", startTimestamp)
|
||||
.where("ced.startsAt", "<", endTimestamp)
|
||||
.where("ttci.checkedInAt", "is not", null)
|
||||
.where("ttci.isCheckOut", "=", 0)
|
||||
.executeTakeFirst();
|
||||
@@ -98,7 +98,7 @@ async function getOrgsWithRecentTournaments(
|
||||
.select("ce.organizationId")
|
||||
.distinct()
|
||||
.where("ce.organizationId", "is not", null)
|
||||
.where("ced.startTime", ">=", earliestTimestamp)
|
||||
.where("ced.startsAt", ">=", earliestTimestamp)
|
||||
.execute();
|
||||
|
||||
return orgs.map((org) => org.organizationId!);
|
||||
|
||||
Reference in New Issue
Block a user