Skip to content

Database tables

Generated from the DB interface of app/db/tables.ts. See Database schemas for how columns are typed. The relations are the foreign keys of the schema the migrations build.

AllTeam

Table backing the Team view. Includes soft-deleted teams.

Rows typed by Team

ColumnTypeDescription
avatarImgIdnumber | null → UnvalidatedUserSubmittedImage
bannerImgIdnumber | null → UnvalidatedUserSubmittedImage
biostring | null
createdAtGenerated<number>
customUrlstring
customThemeJSONColumnTypeNullable<CustomTheme>
deletedAtnumber | null

Soft delete marker. Always null when selected via the Team view, which filters these rows out.

idGeneratedAlways<number>
inviteCodestring
namestring
bskystring | null
mapModePreferencesJSONColumnTypeNullable<UserMapModePreferences>
tagstring | null

Shown in-game in front of members' names

Used by 23 repository functions · 58 routes

SQGroupRepository findMapModePreferencesByGroupIdfindCurrentGroups

SQMatchRepository findByIdcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

TeamRepository findByIdinsertupdateupdateCustomThemeupdateMapModePreferencesdeleteByIdresetInviteCode

TournamentRepository findByIdfindTeamsFullByTournamentIdfindAllForShowcase

TournamentOrganizationRepository findEventsByMonthfindPaginatedEventsBySeries

//api/layout/api/status/calendar/:id/calendar/new/events/friends/org/:slug/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/t/:customUrl/t/:customUrl/edit/t/:customUrl/roster/t/new/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/user/:userId/active-match

Relations (9)
erDiagram
  direction LR
  UnvalidatedUserSubmittedImage |o--o{ AllTeam : "avatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ AllTeam : "bannerImgId"
  AllTeam ||--o{ AllTeamMember : "teamId"
  AllTeam |o--o{ Group : "teamId"
  AllTeam |o--o{ LFGPost : "teamId"
  AllTeam |o--o{ ScrimPost : "teamId"
  AllTeam |o--o{ ScrimPostRequest : "teamId"
  AllTeam ||--o{ TeamEvent : "teamId"
  AllTeam |o--o{ TournamentTeam : "teamId"

Referenced by AllTeamMember.teamId, Group.teamId, LFGPost.teamId, ScrimPost.teamId, ScrimPostRequest.teamId, TeamEvent.teamId, TournamentTeam.teamId

AllTeamMember

Table backing the TeamMember & TeamMemberWithSecondary views. Includes members who have left and members of deleted teams.

Rows typed by TeamMember

ColumnTypeDescription
createdAtGenerated<number>
isOwnerGenerated<DBBoolean>
isManagerGenerated<DBBoolean>
leftAtnumber | null

Always null when selected via the TeamMember or TeamMemberWithSecondary views, which filter these rows out.

roleMemberRole | null
customRolestring | null
roleTypeMemberRoleType | null

If customRole is defined, this classifies how the role should be treated

orderGenerated<number>

User-defined ordering of members within a team (ascending)

teamIdnumber → AllTeam
userIdnumber → User
isMainTeamGenerated<DBBoolean>
Used by 13 repository functions · 11 routes

AdminRepository migrate

SQGroupRepository insertFromPrevioussyncTeamIdmorphGroupsinsertMemberleaveGroup

TeamRepository findResultsByIdinsertswitchOwnMainTeamdeleteByIdinsertOwnMembershiphandleMemberLeavingupdateRoster

/admin/q/q/looking/q/match/:id/q/preparing/q/ready/t/:customUrl/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/new

Relations (2)
erDiagram
  direction LR
  AllTeam ||--o{ AllTeamMember : "teamId"
  User ||--o{ AllTeamMember : "userId"

ApiToken

Rows typed by ApiToken

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
tokenstring
typeGenerated<ApiTokenType>
createdAtGenerated<number>
Used by 4 repository functions · 5 routes

AdminRepository banUser

ApiRepository findTokenByUserIdgenerateTokenfindAllApiTokens

/admin/api/q/refresh-caches/seed

Relations (1)
erDiagram
  direction LR
  User ||--o{ ApiToken : "userId"

Art

Rows typed by Art

ColumnTypeDescription
authorIdnumber → User
createdAtGenerated<number>
descriptionstring | null
idGeneratedAlways<number>
imgIdnumber → UnvalidatedUserSubmittedImage
isShowcaseGenerated<DBBoolean>
Used by 14 repository functions · 101 routes

ArtRepository findShowcaseArtsfindShowcaseArtsByTagfindRecentlyUploadedArtsfindByIdfindArtsByUserIddeleteByIdinsertupdate

ImageRepository deleteByIdcountUnvalidatedArtcountAllUnvalidatedfindAllUnvalidatedcountUnvalidatedBySubmitterUserId

UserRepository findLayoutDataById

/admin/admin/streams/admin/voice/api/api/chat/rooms/:id/mentions/seen/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/voice/rooms/:id/api/voice/telemetry/api/voice/webhook/art/art/new/associations/associations/new/auth/auth/create-link/auth/impersonate/auth/impersonate/stop/auth/logout/auth/refresh/badges/:id/edit/calendar/calendar/:id/calendar/:id/report-winners/calendar/new/end-season/events/friends/ingest/leaderboards/lfg/lfg/new/notifications/seen/notifications/subscribe/org/:slug/org/:slug/edit/org/new/patrons/player/:id/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/run-routine/scrims/scrims/:id/scrims/new/seed/set-plus-voting-active/settings/sidenav/sse/:connectionId/topics/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/roster/t/:customUrl/schedule/t/new/theme/to/:id/admin/to/:id/admin/to/:id/admin/brackets/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/:mid/to/:id/register/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/new/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/art/u/:identifier/builds/u/:identifier/builds/new/u/:identifier/edit/u/:identifier/edit-widgets/u/:identifier/results/highlights/upload/admin/user-card/:id/note/user-card/edit/user-report/:id/vods/:id/vods/new

Relations (4)
erDiagram
  direction LR
  User ||--o{ Art : "authorId"
  UnvalidatedUserSubmittedImage ||--o{ Art : "imgId"
  Art ||--o{ ArtUserMetadata : "artId"
  Art ||--o{ TaggedArt : "artId"

Referenced by ArtUserMetadata.artId, TaggedArt.artId

ArtTag

Rows typed by ArtTag

ColumnTypeDescription
authorIdnumber → User
createdAtGenerated<number>
idGeneratedAlways<number>
namestring
Used by 5 repository functions · 4 routes

ArtRepository findAllTagsdeleteOrphanTagsfindArtsByUserIdinsertupdate

/art/art/new/u/:identifier/u/:identifier/art

Relations (2)
erDiagram
  direction LR
  User ||--o{ ArtTag : "authorId"
  ArtTag ||--o{ TaggedArt : "tagId"

Referenced by TaggedArt.tagId

ArtUserMetadata

Rows typed by ArtUserMetadata

ColumnTypeDescription
artIdnumber → Art
userIdnumber → User
Used by 9 repository functions · 6 routes

ArtRepository unlinkOwnFromArtfindShowcaseArtsfindShowcaseArtsByTagfindRecentlyUploadedArtsfindByIdfindArtsByUserIdinsertupdate

UserRepository findLayoutDataById

/art/art/new/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/art

Relations (2)
erDiagram
  direction LR
  Art ||--o{ ArtUserMetadata : "artId"
  User ||--o{ ArtUserMetadata : "userId"

Association

Rows typed by Association

ColumnTypeDescription
idGeneratedAlways<number>
namestring
inviteCodestring
createdAtGenerated<number>
Used by 7 repository functions · 4 routes

AssociationRepository findByIdfindByMemberUserIdfindByInviteCodefindInviteCodeByIdinsertrefreshInviteCodedeleteById

/associations/associations/new/scrims/scrims/new

Relations (1)
erDiagram
  direction LR
  Association ||--o{ AssociationMember : "associationId"

Referenced by AssociationMember.associationId

AssociationMember

Rows typed by AssociationMember

ColumnTypeDescription
userIdnumber → User
associationIdnumber → Association
role"MEMBER" | "MANAGER" | "ADMIN"

MANAGER can also share the invite link, ADMIN (one per association) can also manage the members

Used by 8 repository functions · 4 routes

AssociationRepository findByIdfindByMemberUserIdfindByInviteCodeinsertinsertMemberupdateMemberRoledeleteMemberhandleMemberLeaving

/associations/associations/new/scrims/scrims/new

Relations (2)
erDiagram
  direction LR
  Association ||--o{ AssociationMember : "associationId"
  User ||--o{ AssociationMember : "userId"

AvailabilityDayNote

Rows typed by AvailabilityDayNote

ColumnTypeDescription
availabilityWeekIdnumber → AvailabilityWeek
datestring

YYYY-MM-DD, in the week's timezone

textstring
Used by 2 repository functions · 7 routes

AvailabilityRepository findAllWeeksByUserIdsupsertOwnWeek

/events/friends/scrims/scrims/new/t/:customUrl/schedule/to/:id/matches/:mid/to/:id/register

Relations (1)
erDiagram
  direction LR
  AvailabilityWeek ||--o{ AvailabilityDayNote : "availabilityWeekId"

AvailabilitySlot

A range the user is available for. Absolute, so a range crossing midnight is one row like any other.

Rows typed by AvailabilitySlot

ColumnTypeDescription
idGeneratedAlways<number>
availabilityWeekIdnumber → AvailabilityWeek
startsAtnumber
endsAtnumber
Used by 2 repository functions · 7 routes

AvailabilityRepository findAllWeeksByUserIdsupsertOwnWeek

/events/friends/scrims/scrims/new/t/:customUrl/schedule/to/:id/matches/:mid/to/:id/register

Relations (1)
erDiagram
  direction LR
  AvailabilityWeek ||--o{ AvailabilitySlot : "availabilityWeekId"

AvailabilityWeek

One week of availability a user reported. The row existing means the week was submitted, which is what tells "unavailable all week" (submitted, no slots) apart from "unknown" (no row).

Rows typed by AvailabilityWeek

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
weekStartsAtnumber

Monday 00:00 of the week, in timezone

timezonestring

IANA timezone the week was reported in, which the day notes' dates are relative to

createdAtGenerated<number>
updatedAtGenerated<number>
Used by 5 repository functions · 8 routes

AvailabilityRepository findAllWeeksByUserIdshasReportedWeekfindWeekReminderUserIdsupsertOwnWeekdeleteWeeksStartedBefore

/api/layout/events/friends/scrims/scrims/new/t/:customUrl/schedule/to/:id/matches/:mid/to/:id/register

Relations (3)
erDiagram
  direction LR
  User ||--o{ AvailabilityWeek : "userId"
  AvailabilityWeek ||--o{ AvailabilityDayNote : "availabilityWeekId"
  AvailabilityWeek ||--o{ AvailabilitySlot : "availabilityWeekId"

Referenced by AvailabilityDayNote.availabilityWeekId, AvailabilitySlot.availabilityWeekId

Badge

Rows typed by Badge

ColumnTypeDescription
idGeneratedAlways<number>
codestring
displayNamestring
huenumber | null
authorIdnumber | null → User

Who made the badge? If null, a legacy badge.

Used by 13 repository functions · 31 routes

AdminRepository migrate

BadgeRepository insertfindAllfindByIdfindByManagersListfindManagedByUserIdfindByOwnerUserIdfindByAuthorUserIdsyncXPBadges

CalendarRepository findAllBetweenTwoTimestampsfindById

TournamentRepository findAllForShowcase

TournamentOrganizationRepository findBySlug

//admin/api/layout/badges/badges/:id/badges/:id/edit/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/new/events/org/:slug/org/:slug/edit/org/:slug/stats/org/new/player/:id/to/:id/admin/to/:id/admin/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/join/to/:id/looking/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/upsert/u/:identifier/u/:identifier/edit-widgets/user/:identifier

Relations (5)
erDiagram
  direction LR
  User |o--o{ Badge : "authorId"
  Badge ||--o{ BadgeManager : "badgeId"
  Badge ||--o{ CalendarEventBadge : "badgeId"
  Badge ||--o{ TournamentBadgeOwner : "badgeId"
  Badge ||--o{ TournamentOrganizationBadge : "badgeId"

Referenced by BadgeManager.badgeId, CalendarEventBadge.badgeId, TournamentBadgeOwner.badgeId, TournamentOrganizationBadge.badgeId

BadgeManager

Rows typed by BadgeManager

ColumnTypeDescription
badgeIdnumber → Badge
userIdnumber → User
Used by 6 repository functions · 8 routes

AdminRepository migrate

BadgeRepository findAllfindByIdfindByManagersListfindManagedByUserIdreplaceManagers

/admin/badges/badges/:id/badges/:id/edit/calendar/new/org/:slug/edit/to/:id/brackets/finalize/u/:identifier

Relations (2)
erDiagram
  direction LR
  Badge ||--o{ BadgeManager : "badgeId"
  User ||--o{ BadgeManager : "userId"

BadgeOwner

VIEW, read-only. TournamentBadgeOwner rows plus a synthetic patron badge row per patron of tier 2+.

View of TournamentBadgeOwner, User

Rows typed by BadgeOwner

ColumnTypeDescription
badgeIdnumber
userIdnumber
countnumber
Used by 2 repository functions · 6 routes

BadgeRepository findByIdfindByOwnerUserId

/badges/:id/badges/:id/edit/to/:id/brackets/finalize/u/:identifier/u/:identifier/edit-widgets/user/:identifier

BanLog

Rows typed by BanLog

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
bannednumber | null
bannedReasonstring | null
bannedByUserIdnumber → User
createdAtGenerated<number>
Used by 4 repository functions · 3 routes

AdminRepository migratebanUserunbanUser

UserRepository findModInfoById

/admin/q/u/:identifier/admin

Relations (2)
erDiagram
  direction LR
  User ||--o{ BanLog : "bannedByUserId"
  User ||--o{ BanLog : "userId"

Build

Abilities are stored as JSON in abilities, BuildAbilitySum & BuildWeaponAbility denormalize them for computing ability point averages.

Rows typed by Build

ColumnTypeDescription
clothesGearSplIdnumber | null
descriptionstring | null
headGearSplIdnumber | null
idGeneratedAlways<number>
isPrivateGenerated<DBBoolean>
modesJSONColumnTypeNullable<ModeShort[]>
ownerIdnumber → User
shoesGearSplIdnumber | null
titlestring
updatedAtGenerated<number>
abilitiesJSONColumnTypeNullable<BuildAbilitiesTuple>

3x4 ability tuple (head/clothes/shoes × main + 3 subs).

abilitiesSignaturestring | null

Serialized ability+AP combo (e.g. SSU_30,ISS_10) used to group identical builds for the popular builds view.

Used by 13 repository functions · 9 routes

AdminRepository migrate

BuildRepository findAllByUserIdinsertupdatedeleteByIdfindOwnerIdByIdfindAllAbilityPointSumsfindNewestBuildPerOwnerByWeaponIdfindPageByWeaponIdfindPageByUserIdcountsByUserIdrecalculateAllSortValues

UserRepository findLayoutDataById

/admin/builds/:slug/builds/:slug/popular/builds/:slug/stats/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/builds/u/:identifier/builds/new

Relations (4)
erDiagram
  direction LR
  User ||--o{ Build : "ownerId"
  Build ||--o{ BuildAbilitySum : "buildId"
  Build ||--o{ BuildWeapon : "buildId"
  Build ||--o{ BuildWeaponAbility : "buildId"

Referenced by BuildAbilitySum.buildId, BuildWeapon.buildId, BuildWeaponAbility.buildId

BuildAbilitySum

Per-build ability point sums across all gear slots. Used to compute global findAllAbilityPointAverages.

Rows typed by BuildAbilitySum

ColumnTypeDescription
buildIdnumber → Build
abilityAbility
abilityPointsnumber
Used by 3 repository functions · 2 routes

BuildRepository insertupdatefindAllAbilityPointSums

/builds/:slug/stats/u/:identifier/builds/new

Relations (1)
erDiagram
  direction LR
  Build ||--o{ BuildAbilitySum : "buildId"

BuildWeapon

Rows typed by BuildWeapon

ColumnTypeDescription
buildIdnumber → Build
weaponSplIdMainWeaponId
canonicalWeaponSplIdMainWeaponId

Alt skins collapse to their base weapon (e.g. Hero Shot Replica 45 → Splattershot 40). Indexed for the builds-by-weapon, popular, and stats queries so they can filter = ? against a covering index instead of IN (alt skins…).

updatedAtGenerated<number>

Mirror of Build.updatedAt. Denormalized so the (canonicalWeaponSplId, sortValue, updatedAt, buildId, ownerId) covering index serves the builds-by-weapon list.

sortValuenumber | null

Per-weapon sort priority: plusTier * 2 + (this weapon is top500 ? 0 : 1) for public builds, NULL for private.

ownerIdnumber

Mirror of Build.ownerId. Denormalized so the builds-by-weapon list pages by author off covering indexes.

Used by 10 repository functions · 8 routes

BuildRepository findAllByUserIdinsertupdatefindAbilityPointCountsByWeaponIdsfindNewestBuildPerOwnerByWeaponIdfindPageByWeaponIdfindPageByUserIdcountsByUserIdcountAllPublicByWeaponIdrecalculateAllSortValues

/admin/builds/builds/:slug/builds/:slug/popular/builds/:slug/stats/u/:identifier/u/:identifier/builds/u/:identifier/builds/new

Relations (1)
erDiagram
  direction LR
  Build ||--o{ BuildWeapon : "buildId"

BuildWeaponAbility

Per-weapon, per-build ability point sums. Used to compute per-weapon findAllAbilityPointAverages. One row per canonical weapon × build × ability with non-zero AP.

Rows typed by BuildWeaponAbility

ColumnTypeDescription
canonicalWeaponSplIdMainWeaponId
buildIdnumber → Build
abilityAbility
abilityPointsnumber
Used by 4 repository functions · 3 routes

BuildRepository insertupdatefindAbilityPointCountsByWeaponIdsfindPageByWeaponId

/builds/:slug/builds/:slug/stats/u/:identifier/builds/new

Relations (1)
erDiagram
  direction LR
  Build ||--o{ BuildWeaponAbility : "buildId"

CalendarEvent

Rows typed by CalendarEvent

ColumnTypeDescription
authorIdnumber → User
bracketUrlstring
descriptionstring | null
discordInviteCodestring | null
idGeneratedAlways<number>
discordUrlGeneratedAlways<string | null>
namestring
participantCountnumber | null
tagsJSONColumnTypeNullable<CalendarEventTag[]>
hiddenGenerated<DBBoolean>
tournamentIdnumber | null → Tournament
organizationIdnumber | null → TournamentOrganization
avatarImgIdnumber | null → UnvalidatedUserSubmittedImage
trophyIdnumber | null → Trophy
Used by 71 repository functions · 136 routes

CalendarRepository findAllBetweenTwoTimestampsfindByIdfindAvatarImgIdsfindRecentTournamentsByOrganizerUserIdinsertupdateupsertReportedScoresdeleteById

FriendRepository findByUserIdWithActivity

ImageRepository findByIdcountAllUnvalidatedfindAllUnvalidatedcountUnvalidatedBySubmitterUserId

SkillRepository findSeasonProgressionByUserIdfindSeasonActiveDaysByUserId

ScannerIngestRepository staffTournamentIdsAt

ScrimMapListRepository findMapListsByScrimPostId

ScrimPostRepository findByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindPendingOverlapsForUsersfindUserScrims

PlayerStatRepository findSeasonBestSetsByUserIdfindSeasonTournamentRunsByUserId

SQMatchRepository findSeasonResultsByUserIdfindSeasonDaySummariesByUserId

TeamRepository findResultsById

SavedCalendarEventRepository saveOwnunsaveByUserIdisSavedfindAllUpcomingByUserIddeleteByTournamentId

TournamentRepository findByIdfindDescriptionByIdfindLatestFinalizedLeagueParticipantsfindTOSetMapPoolByIdfindRelatedUsersByTournamentIdsfindAllForShowcasefindAllBetweenTwoTimestampsfindPendingCheckInsStartingBetweenfindOrganizerPermissionsByTournamentIdssearchByNamefindRunningTournamentIds

TournamentTeamRepository findAllByChatRoomIdsupdateOwnMemberInGameNameForNonStartedinsertupsertRegistrationjoinfindAllRegistrationsByUserIds

TournamentMatchVodRepository findTournamentsNeedingVodSyncdeleteObsolete

TournamentMatchRepository findAllByChatRoomIdsfindScheduledByUserIdsfindScheduledByUserId

TournamentOrganizationRepository findEventsByMonthfindAllOrganizedTournamentTeamCountsfindAllUnfinalizedEventsfindPaginatedEventsBySeriesfindAllEventsBySeriesfindAllSeriesWinsByUserIdcountActiveParticipantsupdate

TrophyRepository allfindByOrganizationIdfindTournamentsByTrophyIdfindWinsByOwnerfindAllBackfillableTournamentsbackfill

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserId

//admin/admin/streams/admin/voice/api/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/mentions/seen/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/telemetry/api/voice/webhook/art/new/associations/associations/new/auth/auth/create-link/auth/impersonate/auth/impersonate/stop/auth/logout/auth/refresh/badges/:id/edit/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/:year/:week/calendar/new/end-season/events/friends/ingest/leaderboards/lfg/lfg/new/notifications/seen/notifications/subscribe/org/:slug/org/:slug/edit/org/:slug/stats/org/new/patrons/player/:id/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/run-routine/scrims/scrims/:id/scrims/new/search/seed/set-plus-voting-active/settings/sidenav/sse/:connectionId/topics/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/theme/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/to/search/tournament-match/:id/tournament/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/tournaments/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/admin/u/:identifier/art/u/:identifier/builds/u/:identifier/builds/new/u/:identifier/edit/u/:identifier/edit-widgets/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/upload/admin/user-card/:id/note/user-card/edit/user-report/:id/vods/:id/vods/new

Relations (11)
erDiagram
  direction LR
  User ||--o{ CalendarEvent : "authorId"
  UnvalidatedUserSubmittedImage |o--o{ CalendarEvent : "avatarImgId"
  TournamentOrganization |o--o{ CalendarEvent : "organizationId"
  Tournament |o--o{ CalendarEvent : "tournamentId"
  Trophy |o--o{ CalendarEvent : "trophyId"
  CalendarEvent ||--o{ CalendarEventBadge : "eventId"
  CalendarEvent ||--o{ CalendarEventDate : "eventId"
  CalendarEvent ||--o{ CalendarEventResultTeam : "eventId"
  CalendarEvent |o--o{ MapPoolMap : "calendarEventId"
  CalendarEvent ||--o{ SavedCalendarEvent : "calendarEventId"
  CalendarEvent |o--o{ UnvalidatedVideo : "eventId"

Referenced by CalendarEventBadge.eventId, CalendarEventDate.eventId, CalendarEventResultTeam.eventId, MapPoolMap.calendarEventId, SavedCalendarEvent.calendarEventId, UnvalidatedVideo.eventId

CalendarEventBadge

Rows typed by CalendarEventBadge

ColumnTypeDescription
badgeIdnumber → Badge
eventIdnumber → CalendarEvent
Used by 5 repository functions · 19 routes

CalendarRepository findAllBetweenTwoTimestampsfindByIdinsertupdate

TournamentRepository findAllForShowcase

//api/layout/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/new/events/to/:id/admin/to/:id/admin/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/join/to/:id/looking/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/upsert

Relations (2)
erDiagram
  direction LR
  Badge ||--o{ CalendarEventBadge : "badgeId"
  CalendarEvent ||--o{ CalendarEventBadge : "eventId"

CalendarEventDate

A regular calendar event can have many dates, a tournament only one.

Rows typed by CalendarEventDate

ColumnTypeDescription
eventIdnumber → CalendarEvent
idGeneratedAlways<number>
startsAtnumber
Used by 41 repository functions · 72 routes

CalendarRepository findAllBetweenTwoTimestampsfindByIdfindRecentTournamentsByOrganizerUserIdinsertupdate

FriendRepository findByUserIdWithActivity

SkillRepository findSeasonProgressionByUserIdfindSeasonActiveDaysByUserId

SQMatchRepository findSeasonResultsByUserIdfindSeasonDaySummariesByUserId

TeamRepository findResultsById

TournamentRepository findByIdfindLatestFinalizedLeagueParticipantsfindRelatedUsersByTournamentIdsfindAllForShowcasefindAllBetweenTwoTimestampsfindPendingCheckInsStartingBetweensearchByNamefindRunningTournamentIds

TournamentTeamRepository updateOwnMemberInGameNameForNonStartedinsertupsertRegistrationjoinfindAllRegistrationsByUserIds

TournamentMatchVodRepository findTournamentsNeedingVodSyncdeleteObsolete

TournamentOrganizationRepository findEventsByMonthfindAllOrganizedTournamentTeamCountsfindPaginatedEventsBySeriesfindAllEventsBySeriesfindAllSeriesWinsByUserIdcountActiveParticipantsupdate

TrophyRepository allfindByOrganizationIdfindTournamentsByTrophyIdfindWinsByOwnerfindAllBackfillableTournaments

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserId

//api/layout/api/status/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/:year/:week/calendar/new/events/friends/org/:slug/org/:slug/edit/org/:slug/stats/refresh-caches/scrims/scrims/new/search/seed/t/:customUrl/results/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/to/search/tournament-match/:id/tournament/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/tournaments/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/edit/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic

Relations (1)
erDiagram
  direction LR
  CalendarEvent ||--o{ CalendarEventDate : "eventId"

CalendarEventResultPlayer

Rows typed by CalendarEventResultPlayer

ColumnTypeDescription
namestring | null
teamIdnumber → CalendarEventResultTeam
userIdnumber | null → User
Used by 11 repository functions · 9 routes

CalendarRepository findResultsByEventIdfindTopThreeResultsByEventIdsupsertReportedScores

TournamentOrganizationRepository findEventsByMonthfindPaginatedEventsBySeriesfindAllSeriesWinsByUserId

UserRepository findLayoutDataByIdfindWidgetsByUserIdfindResultsByUserIdcountResultsByUserIdfindResultPlacementsByUserId

/calendar/:id/calendar/:id/report-winners/org/:slug/to/:id/teams/:tid/comps/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/results/u/:identifier/results/highlights

Relations (2)
erDiagram
  direction LR
  CalendarEventResultTeam ||--o{ CalendarEventResultPlayer : "teamId"
  User |o--o{ CalendarEventResultPlayer : "userId"

CalendarEventResultTeam

Results of events not hosted on sendou.ink.

Rows typed by CalendarEventResultTeam

ColumnTypeDescription
eventIdnumber → CalendarEvent
idGeneratedAlways<number>
namestring
placementnumber
Used by 10 repository functions · 7 routes

CalendarRepository findResultsByEventIdfindTopThreeResultsByEventIdsupsertReportedScores

TournamentOrganizationRepository findEventsByMonthfindPaginatedEventsBySeriesfindAllSeriesWinsByUserId

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserIdfindResultPlacementsByUserId

/calendar/:id/calendar/:id/report-winners/org/:slug/to/:id/teams/:tid/comps/u/:identifier/u/:identifier/results/u/:identifier/results/highlights

Relations (3)
erDiagram
  direction LR
  CalendarEvent ||--o{ CalendarEventResultTeam : "eventId"
  CalendarEventResultTeam ||--o{ CalendarEventResultPlayer : "teamId"
  CalendarEventResultTeam ||--o{ UserResultHighlight : "teamId"

Referenced by CalendarEventResultPlayer.teamId, UserResultHighlight.teamId

ChatMessage

Rows typed by ChatMessage

ColumnTypeDescription
authorUserIdnumber | null → User

The sender, or for a system message the actor it describes. null only when that account has since been deleted.

contentsstring | null

null for system messages, whose text is rendered client-side from {@link ChatMessage.type}.

createdAtGenerated<number>
idGeneratedAlways<number>
publicIdstring

Client-generated nanoid, unique so a retried send can't double-insert.

roomIdnumber → ChatRoom
typePersistedSystemMessageType | null

null = a regular user message.

Used by 5 repository functions · 7 routes

ChatRepository findAllMessagesByRoomIdfindMessageByIdfindMessageStatsByRoomIdsinsertMessageinsertSystemMessage

/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/q/looking/q/match/:id/scrims/:id/to/:id/matches/:mid

Relations (2)
erDiagram
  direction LR
  User |o--o{ ChatMessage : "authorUserId"
  ChatRoom ||--o{ ChatMessage : "roomId"

ChatMessageReadIndicator

Rows typed by ChatMessageReadIndicator

ColumnTypeDescription
lastSeenMessageIdnumber

Id of the newest message the user has seen in the room; upserts keep the MAX.

roomIdnumber → ChatRoom
userIdnumber → User
Used by 2 repository functions · 8 routes

ChatRepository findMessageStatsByRoomIdsupsertReadIndicator

/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/q/looking/q/match/:id/scrims/:id/to/:id/matches/:mid

Relations (2)
erDiagram
  direction LR
  ChatRoom ||--o{ ChatMessageReadIndicator : "roomId"
  User ||--o{ ChatMessageReadIndicator : "userId"

ChatRoom

Rows typed by ChatRoom

ColumnTypeDescription
closedAtnumber | null

Set by a routine ~a month after expiresAt; messages are kept but access narrows to staff and tournament organizers.

createdAtGenerated<number>
expiresAtnumber
idGeneratedAlways<number>
inactiveGenerated<DBBoolean>

The owner's activity has concluded, e.g. the set the room was for was finalized or canceled. Reverted if a tournament match is reopened.

typeChatRoomType
Used by 11 repository functions · 19 routes

ChatRepository findAllRoomsByIdsfindAllOpenRoomIdsByUserIdinsertRoominsertRoomsupdateRoomExpiresAtupdateRoomsExpiresAtupdateRoomsInactivecloseExpiredRoomsdeleteOrphanedRooms

VoiceRepository findDailyAdoptionSincefindPlayerAdoptionSince

/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/voice/rooms/:id/api/voice/webhook/q/q/looking/q/match/:id/q/ready/scrims/scrims/:id/sse/:connectionId/topics/to/:id/admin/to/:id/admin/to/:id/brackets/to/:id/looking/to/:id/matches/:mid

Relations (8)
erDiagram
  direction LR
  ChatRoom ||--o{ ChatMessage : "roomId"
  ChatRoom ||--o{ ChatMessageReadIndicator : "roomId"
  ChatRoom |o--o| Group : "chatRoomId"
  ChatRoom |o--o| GroupMatch : "chatRoomId"
  ChatRoom |o--o| ScrimPost : "chatRoomId"
  ChatRoom |o--o| TournamentMatch : "chatRoomId"
  ChatRoom |o--o| TournamentTeam : "chatRoomId"
  ChatRoom |o--o{ VoiceSession : "roomId"

Referenced by ChatMessage.roomId, ChatMessageReadIndicator.roomId, Group.chatRoomId, GroupMatch.chatRoomId, ScrimPost.chatRoomId, TournamentMatch.chatRoomId, TournamentTeam.chatRoomId, VoiceSession.roomId

ExternalStream

Rows typed by ExternalStream

ColumnTypeDescription
idGeneratedAlways<number>
namestring
urlstring
avatarImgIdnumber | null → UnvalidatedUserSubmittedImage
startsAtnumber
createdAtGenerated<number>
Used by 5 repository functions · 2 routes

ExternalStreamRepository insertdeleteByIdfindAllfindAllForSidebardeleteOld

/admin/streams/api/layout

Relations (1)
erDiagram
  direction LR
  UnvalidatedUserSubmittedImage |o--o{ ExternalStream : "avatarImgId"

FriendRequest

Pending friend request from one user to another.

Rows typed by FriendRequest

ColumnTypeDescription
idGeneratedAlways<number>
senderIdnumber → User
receiverIdnumber → User
createdAtGenerated<number>
Used by 11 repository functions · 3 routes

FriendRepository findPendingSentRequestsinsertFriendRequestdeleteFriendRequestdeleteOldPendingRequestsfindFriendRequestBetweenfindPendingReceivedRequestsfindPendingReceivedRequestIdsinsertFriendshipfindFriendRequestByIdAndReceiverdeleteFriendRequestByReceivercountPendingSentRequests

/api/layout/friends/user-card/:id/friendship

Relations (2)
erDiagram
  direction LR
  User ||--o{ FriendRequest : "receiverId"
  User ||--o{ FriendRequest : "senderId"

Friendship

Mutual friendship between two users. Invariant: userOneId < userTwoId.

Rows typed by Friendship

ColumnTypeDescription
idGeneratedAlways<number>
userOneIdnumber → User
userTwoIdnumber → User
createdAtGenerated<number>
isPinnedByUserOneGenerated<DBBoolean>

userOne keeps this friend at the top of their friends list

isPinnedByUserTwoGenerated<DBBoolean>

userTwo keeps this friend at the top of their friends list

Used by 10 repository functions · 13 routes

AvailabilityRepository findScheduleVisibleUserIds

FriendRepository findByUserIdWithActivitydeleteOwnFriendshipByIdupdateOwnFriendshipPinnedinsertFriendshipfindMutualFriendsfindFriendsByUserIdfindFriendIdsfindFriendship

SQGroupRepository findFriendsAndTeammates

/api/layout/associations/friends/friends-for-adding/q/preparing/scrims/scrims/new/t/:customUrl/schedule/to/:id/matches/:mid/to/:id/register/u/:identifier/u/:identifier/user-card/:id/friendship

Relations (2)
erDiagram
  direction LR
  User ||--o{ Friendship : "userOneId"
  User ||--o{ Friendship : "userTwoId"

Group

SendouQ group. A new group is created every time even if the same players rejoin the queue after their match.

Rows typed by Group

ColumnTypeDescription
chatRoomIdnumber | null → ChatRoom
createdAtGenerated<number>
idGeneratedAlways<number>
inviteCodestring
latestActionAtGenerated<number>
matchmadeGenerated<DBBoolean>

If truthy, group was at least partly made in the matchmaking UI (/q/looking)

status"PREPARING" | "ACTIVE" | "INACTIVE" | "READY_CHECK"
teamIdnumber | null → AllTeam
tierNameTierName | null

Tier the group held as its match was created, snapshotted because tier thresholds are percentiles of the season's live distribution and so shift as the season goes on. null until the group gets a match, and for matches made before this was recorded. The queue shows a live tier instead, so this is only read by the match page.

tierIsPlusGenerated<DBBoolean>

Second half of {@link Group.tierName}, meaningless while that is null.

Used by 37 repository functions · 29 routes

ChatRepository findAllOpenRoomIdsByUserId

SQGroupRepository findMapModePreferencesByGroupIdfindAllByChatRoomIdsfindCurrentGroupsfindActiveGroupMembersinsertinsertFromPrevioussyncTeamIdmorphGroupsinsertMemberfindCurrentReceivedLikerGroupIdssetOldGroupsAsInactivecloseExpiredContinueVotesinsertLikeinsertSuggestiondeleteLikeleaveGrouprefreshGroupupdateOwnMemberNoteinsertReadyCheckdeleteReadyChecksetPreparingGroupAsActivesetAsInactive

SQMatchRepository findByIdfindSeasonResultsByUserIdfindSeasonCanceledMatchesByUserIdinsertcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

QStreamsRepository findAllActiveMatchPlayers

VoiceRepository findPlayerAdoptionSince

/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/webhook/friends/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/refresh-caches/scrims/:id/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/sse/:connectionId/topics/to/:id/admin/to/:id/admin/to/:id/matches/:mid/u/:identifier/seasons/u/:identifier/seasons/user/:userId/active-match

Relations (14)
erDiagram
  direction LR
  ChatRoom |o--o| Group : "chatRoomId"
  AllTeam |o--o{ Group : "teamId"
  Group ||--o{ GroupLike : "likerGroupId"
  Group ||--o{ GroupLike : "targetGroupId"
  Group ||--o| GroupMatch : "alphaGroupId"
  Group ||--o| GroupMatch : "bravoGroupId"
  Group ||--o{ GroupMatchCancelReport : "groupId"
  Group ||--o{ GroupMatchContinueVote : "groupId"
  Group |o--o{ GroupMatchMap : "winnerGroupId"
  Group ||--o{ GroupMember : "groupId"
  Group ||--o| GroupReadyCheck : "alphaGroupId"
  Group ||--o| GroupReadyCheck : "bravoGroupId"
  Group ||--o{ GroupSuggestion : "suggesterGroupId"
  Group ||--o{ GroupSuggestion : "targetGroupId"

Referenced by GroupLike.likerGroupId, GroupLike.targetGroupId, GroupMatch.alphaGroupId, GroupMatch.bravoGroupId, GroupMatchCancelReport.groupId, GroupMatchContinueVote.groupId, GroupMatchMap.winnerGroupId, GroupMember.groupId, GroupReadyCheck.alphaGroupId, GroupReadyCheck.bravoGroupId, GroupSuggestion.suggesterGroupId, GroupSuggestion.targetGroupId

GroupLike

Rows typed by GroupLike

ColumnTypeDescription
createdAtGenerated<number>
likerGroupIdnumber → Group
targetGroupIdnumber → Group
isRechallengeGenerated<DBBoolean>
createdByUserIdnumber | null → User

Member of the liker group who sent the invite. null for invites sent before the column existed.

Used by 12 repository functions · 13 routes

SQGroupRepository deleteLikesAndSuggestionsByGroupIdmorphGroupsinsertMemberfindCurrentReceivedLikerGroupIdsfindAllLikesByGroupIdrechallengesetOldGroupsAsInactiveinsertLikedeleteLikedeleteAllLikesByGroupIdleaveGroupinsertReadyCheck

/api/layout/api/status/friends/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/seed/sendouq/active-match/:userId/settings/user/:userId/active-match

Relations (3)
erDiagram
  direction LR
  User |o--o{ GroupLike : "createdByUserId"
  Group ||--o{ GroupLike : "likerGroupId"
  Group ||--o{ GroupLike : "targetGroupId"

GroupMatch

Rows typed by GroupMatch

ColumnTypeDescription
alphaGroupIdnumber → Group
bravoGroupIdnumber → Group
chatRoomIdnumber | null → ChatRoom
confirmedAtnumber | null
confirmedByUserIdnumber | null → User
createdAtGenerated<number>
idGeneratedAlways<number>
cancelRequestedByUserIdnumber | null → User
cancelAcceptedByUserIdnumber | null → User
noScreenGenerated<DBBoolean>
Used by 39 repository functions · 46 routes

ChatRepository findAllOpenRoomIdsByUserId

LeaderboardRepository findSeasonPopularUsersWeapon

SkillRepository findSeasonProgressionByUserIdfindSeasonActiveDaysByUserId

ScannerIngestRepository gamesInGroupMatchsendouqGamesPlayedByUserSincegroupMatchIdAtfindScoreboardsByGroupMatchId

SQGroupRepository findCurrentGroupsinsertinsertMembersetOldGroupsAsInactivecloseExpiredContinueVotesfindRecentlyFinishedMatchesleaveGroup

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserId

ReportedWeaponRepository findAllWeaponUsageStats

SQMatchRepository existsfindAllByChatRoomIdsfindLiveStateByIdfindByIdfindSeasonResultsByUserIdfindSeasonDaySummariesByUserIdfindSeasonCanceledMatchesByUserIdfindCancelNominationCountsByUserIdsinsertcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerfindUnfinishedMatchesCreatedBeforeresolveUnfinishedMatchundoMatchReportundoMapReport

QStreamsRepository findAllActiveMatchPlayers

VoiceRepository findPlayerAdoptionSince

//admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/webhook/friends/ingest/leaderboards/lfg/plus/suggestions/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/refresh-caches/scrims/scrims/:id/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/sse/:connectionId/topics/to/:id/admin/to/:id/admin/to/:id/admin/seeds/to/:id/looking/to/:id/matches/:mid/to/:id/streams/trophies/:id/wins/:userId/u/:identifier/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user-card/edit/user-report/:id/user/:userId/active-match/weapon-usage

Relations (12)
erDiagram
  direction LR
  Group ||--o| GroupMatch : "alphaGroupId"
  Group ||--o| GroupMatch : "bravoGroupId"
  User |o--o{ GroupMatch : "cancelAcceptedByUserId"
  User |o--o{ GroupMatch : "cancelRequestedByUserId"
  ChatRoom |o--o| GroupMatch : "chatRoomId"
  User |o--o{ GroupMatch : "confirmedByUserId"
  GroupMatch ||--o{ GroupMatchCancelReport : "groupMatchId"
  GroupMatch ||--o{ GroupMatchMap : "matchId"
  GroupMatch |o--o{ IngestedMatch : "groupMatchIdHint"
  GroupMatch |o--o{ ReportedWeapon : "groupMatchId"
  GroupMatch |o--o{ Skill : "groupMatchId"
  GroupMatch |o--o{ UserReport : "matchId"

Referenced by GroupMatchCancelReport.groupMatchId, GroupMatchMap.matchId, IngestedMatch.groupMatchIdHint, ReportedWeapon.groupMatchId, Skill.groupMatchId, UserReport.matchId

GroupMatchCancelReport

One team's account of why a SendouQ match was canceled. Staff-only information.

Rows typed by GroupMatchCancelReport

ColumnTypeDescription
idGeneratedAlways<number>
groupMatchIdnumber → GroupMatch
groupIdnumber → Group
authorUserIdnumber → User
reasonstring
createdAtGenerated<number>
Used by 9 repository functions · 2 routes

SQMatchRepository findSeasonCanceledMatchesByUserIdfindCancelReportsByGroupMatchIdfindCancelNominationCountsByUserIdscancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatch

/q/match/:id/u/:identifier/seasons

Relations (4)
erDiagram
  direction LR
  User ||--o{ GroupMatchCancelReport : "authorUserId"
  Group ||--o{ GroupMatchCancelReport : "groupId"
  GroupMatch ||--o{ GroupMatchCancelReport : "groupMatchId"
  GroupMatchCancelReport ||--o{ GroupMatchCancelReportPlayer : "cancelReportId"

Referenced by GroupMatchCancelReportPlayer.cancelReportId

GroupMatchCancelReportPlayer

Player nominated as a cause of the cancellation in a {@link GroupMatchCancelReport}.

Rows typed by GroupMatchCancelReportPlayer

ColumnTypeDescription
cancelReportIdnumber → GroupMatchCancelReport
userIdnumber → User
Used by 5 repository functions · 2 routes

SQMatchRepository findSeasonCanceledMatchesByUserIdfindCancelReportsByGroupMatchIdfindCancelNominationCountsByUserIdsrequestCancelMatchacceptCancelMatch

/q/match/:id/u/:identifier/seasons

Relations (2)
erDiagram
  direction LR
  GroupMatchCancelReport ||--o{ GroupMatchCancelReportPlayer : "cancelReportId"
  User ||--o{ GroupMatchCancelReportPlayer : "userId"

GroupMatchContinueVote

Rows typed by GroupMatchContinueVote

ColumnTypeDescription
idGeneratedAlways<number>
groupIdnumber → Group
userIdnumber → User
isContinuingDBBoolean
votedAtGenerated<number>
Used by 14 repository functions · 4 routes

SQGroupRepository insertinsertMembercloseExpiredContinueVotes

GroupMatchContinueVoteRepository findAllByGroupIdscastOwnVote

SQMatchRepository findByIdcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

/q/q/match/:id/q/preparing/sendouq/match/:matchId

Relations (2)
erDiagram
  direction LR
  Group ||--o{ GroupMatchContinueVote : "groupId"
  User ||--o{ GroupMatchContinueVote : "userId"

GroupMatchMap

Rows typed by GroupMatchMap

ColumnTypeDescription
idGeneratedAlways<number>
indexnumber
matchIdnumber → GroupMatch
modeModeShort
reportedAtnumber | null
reportedByUserIdnumber | null → User
sourceDBTournamentMaplistSource
stageIdStageId
winnerGroupIdnumber | null → Group
Used by 18 repository functions · 8 routes

ScannerIngestRepository gamesInGroupMatchsendouqGamesPlayedByUserSincefindScoreboardsByGroupMatchId

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonBestSetsByUserId

ReportedWeaponRepository findAllWeaponUsageStats

SQMatchRepository findByIdfindSeasonResultsByUserIdfindSeasonDaySummariesByUserIdinsertcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

/ingest/q/match/:id/q/ready/sendouq/match/:matchId/to/:id/matches/:mid/u/:identifier/seasons/u/:identifier/seasons/summary-graphic/weapon-usage

Relations (4)
erDiagram
  direction LR
  GroupMatch ||--o{ GroupMatchMap : "matchId"
  User |o--o{ GroupMatchMap : "reportedByUserId"
  Group |o--o{ GroupMatchMap : "winnerGroupId"
  GroupMatchMap |o--o{ IngestedMatchLink : "groupMatchMapId"

Referenced by IngestedMatchLink.groupMatchMapId

GroupMember

Rows typed by GroupMember

ColumnTypeDescription
addedByUserIdnumber | null → User

Member who quick added this one as their friend, null if they joined on their own.

createdAtGenerated<number>
groupIdnumber → Group
missedReadyCheckAtnumber | null

When the member last let a {@link GroupReadyCheck} expire without confirming, letting the rest of the group kick them. null if they have not.

notestring | null
userIdnumber → User
tierNameTierName | "CALCULATING" | null

Tier the member held as their group's match was created, snapshotted for the same reason as {@link Group.tierName}. "CALCULATING" when they had too few ranked sets of the season to have a tier yet, null when the group never got a match.

tierIsPlusGenerated<DBBoolean>

Second half of {@link GroupMember.tierName}, meaningless unless that names a tier.

Used by 45 repository functions · 34 routes

AdminRepository migrate

ChatRepository findAllOpenRoomIdsByUserId

ScannerIngestRepository gamesInGroupMatchsendouqGamesPlayedByUserSincegroupMatchIdAt

SQGroupRepository findMapModePreferencesByGroupIdfindAllByChatRoomIdsfindCurrentGroupsfindActiveGroupMembersinsertinsertFromPrevioussyncTeamIdmorphGroupsinsertMembercloseExpiredContinueVotesfindRecentlyFinishedMatchesleaveGroupupdateOwnMemberNotefindAllMissedReadyCheckUserIdsByGroupIdfindReadyCheckByGroupIdfindAllReadyChecksStartedBeforeinsertReadyCheckinsertReadyCheckConfirmationdeleteReadyCheck

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserId

ReportedWeaponRepository findAllWeaponUsageStats

SQMatchRepository findAllByChatRoomIdsfindByIdfindSeasonResultsByUserIdfindSeasonDaySummariesByUserIdfindSeasonCanceledMatchesByUserIdinsertcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerfindUnfinishedMatchesCreatedBeforeresolveUnfinishedMatchundoMatchReportundoMapReport

QStreamsRepository findAllActiveMatchPlayers

VoiceRepository findPlayerAdoptionSince

/admin/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/webhook/friends/ingest/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/refresh-caches/scrims/:id/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/sse/:connectionId/topics/to/:id/admin/to/:id/admin/to/:id/matches/:mid/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user/:userId/active-match/weapon-usage

Relations (3)
erDiagram
  direction LR
  User |o--o{ GroupMember : "addedByUserId"
  Group ||--o{ GroupMember : "groupId"
  User ||--o{ GroupMember : "userId"

GroupReadyCheck

Both groups' members confirming they are ready to play, before their match is created

Rows typed by GroupReadyCheck

ColumnTypeDescription
alphaGroupIdnumber → Group
bravoGroupIdnumber → Group
createdAtGenerated<number>
idGeneratedAlways<number>
Used by 6 repository functions · 4 routes

SQGroupRepository leaveGroupfindReadyCheckByGroupIdfindAllReadyChecksStartedBeforeinsertReadyCheckinsertReadyCheckConfirmationdeleteReadyCheck

/q/q/looking/q/preparing/q/ready

Relations (3)
erDiagram
  direction LR
  Group ||--o| GroupReadyCheck : "alphaGroupId"
  Group ||--o| GroupReadyCheck : "bravoGroupId"
  GroupReadyCheck ||--o{ GroupReadyCheckConfirmation : "readyCheckId"

Referenced by GroupReadyCheckConfirmation.readyCheckId

GroupReadyCheckConfirmation

One member confirming they are ready to play in a {@link GroupReadyCheck}

Rows typed by GroupReadyCheckConfirmation

ColumnTypeDescription
createdAtGenerated<number>
readyCheckIdnumber → GroupReadyCheck
userIdnumber → User
Used by 5 repository functions · 4 routes

SQGroupRepository leaveGroupfindReadyCheckByGroupIdinsertReadyCheckinsertReadyCheckConfirmationdeleteReadyCheck

/q/q/looking/q/preparing/q/ready

Relations (2)
erDiagram
  direction LR
  GroupReadyCheck ||--o{ GroupReadyCheckConfirmation : "readyCheckId"
  User ||--o{ GroupReadyCheckConfirmation : "userId"

GroupSuggestion

A group member pointing their own group at another group, without inviting it

Rows typed by GroupSuggestion

ColumnTypeDescription
createdAtGenerated<number>
suggesterGroupIdnumber → Group

Group whose members see the suggestion

targetGroupIdnumber → Group
createdByUserIdnumber → User
Used by 9 repository functions · 4 routes

SQGroupRepository deleteLikesAndSuggestionsByGroupIdmorphGroupsinsertMemberfindAllSuggestionsByGroupIdsetOldGroupsAsInactiveinsertLikeinsertSuggestionleaveGroupinsertReadyCheck

/q/q/looking/q/preparing/q/ready

Relations (3)
erDiagram
  direction LR
  User ||--o{ GroupSuggestion : "createdByUserId"
  Group ||--o{ GroupSuggestion : "suggesterGroupId"
  Group ||--o{ GroupSuggestion : "targetGroupId"

IngestedMatch

Rows typed by IngestedMatch

ColumnTypeDescription
idGeneratedAlways<number>
povUserIdnumber | null → User
submitterUserIdnumber | null → User
playedAtnumber | null

database timestamp (seconds) the match was played at, when known

dataJSONColumnType<ScannerMatch>
matchHashstring
tournamentIdHintnumber | null → Tournament

server-resolved tournament the match probably belongs to; aids future linking

groupMatchIdHintnumber | null → GroupMatch

server-resolved SendouQ match the match probably belongs to; aids future linking

createdAtGenerated<number>
Used by 13 repository functions · 4 routes

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchesgamesInGroupMatchsendouqGamesPlayedByUserSincefindScoreboardsByTournamentMatchIdfindScoreboardsByGroupMatchIdaddOrMergeMatchesaddLinksfindUnlinkedMatchesByHintfindIngestQuotaUsagedeleteUnlinkedMatchesCreatedBefore

/ingest/q/match/:id/to/:id/matches/:mid/to/:id/teams/:tid/comps

Relations (6)
erDiagram
  direction LR
  GroupMatch |o--o{ IngestedMatch : "groupMatchIdHint"
  User |o--o{ IngestedMatch : "povUserId"
  User |o--o{ IngestedMatch : "submitterUserId"
  Tournament |o--o{ IngestedMatch : "tournamentIdHint"
  IngestedMatch ||--o| IngestedMatchLink : "ingestedMatchId"
  IngestedMatch |o--o{ ReportedWeapon : "ingestedMatchId"

Referenced by IngestedMatchLink.ingestedMatchId, ReportedWeapon.ingestedMatchId

Links an ingested match to the game result it describes (exactly one target).

Rows typed by IngestedMatchLink

ColumnTypeDescription
idGeneratedAlways<number>
ingestedMatchIdnumber → IngestedMatch
tournamentMatchGameResultIdnumber | null → TournamentMatchGameResult
groupMatchMapIdnumber | null → GroupMatchMap
createdAtGenerated<number>
Used by 12 repository functions · 4 routes

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchesgamesInGroupMatchsendouqGamesPlayedByUserSincefindScoreboardsByTournamentMatchIdfindScoreboardsByGroupMatchIdaddLinksfindUnlinkedMatchesByHintdeleteUnlinkedMatchesCreatedBeforedeleteLinksByGroupMatchMapId

/ingest/q/match/:id/to/:id/matches/:mid/to/:id/teams/:tid/comps

Relations (3)
erDiagram
  direction LR
  GroupMatchMap |o--o{ IngestedMatchLink : "groupMatchMapId"
  IngestedMatch ||--o| IngestedMatchLink : "ingestedMatchId"
  TournamentMatchGameResult |o--o{ IngestedMatchLink : "tournamentMatchGameResultId"

LeaderboardTeamSkip

A team that is shown on the team leaderboard but doesn't count for its placements, e.g. because its players want to qualify with another roster.

Rows typed by LeaderboardTeamSkip

ColumnTypeDescription
idGeneratedAlways<number>
seasonnumber
identifierSkillTeamIdentifier

The team's roster, same as Skill.identifier.

skippedByUserIdnumber → User
createdAtGenerated<number>
Used by 3 repository functions · 4 routes

LeaderboardRepository findTeamLeaderboardBySeasoninsertTeamSkipdeleteTeamSkip

//leaderboards/u/:identifier/seasons/u/:identifier/seasons/summary-graphic

Relations (1)
erDiagram
  direction LR
  User ||--o{ LeaderboardTeamSkip : "skippedByUserId"

LFGPost

Rows typed by LFGPost

ColumnTypeDescription
idGeneratedAlways<number>
typeLFGType
textstring
timezonestring

e.g. Europe/Helsinki

authorIdnumber → User
teamIdnumber | null → AllTeam
plusTierVisibilitynumber | null
languagesJSONColumnTypeNullable<UnifiedLanguageCode[]>
updatedAtGenerated<number>
createdAtGenerated<number>
Used by 13 repository functions · 19 routes

AdminRepository migrate

LFGRepository findBoardPagefindVisibleByIdfindAllOwnfindByAuthorUserIdfindAllVisibleParticipantIdsinsertPostupdatePostbumpPostdeletePostdeletePostsByTeamId

UserCardRepository findAllByUserIdsfindAllByUserIdsCached

/admin/lfg/lfg/new/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/scrims/scrims/:id/t/:customUrl/to/:id/admin/seeds/to/:id/looking/to/:id/matches/:mid/to/:id/streams/trophies/:id/wins/:userId/u/:identifier/user-card/edit

Relations (2)
erDiagram
  direction LR
  User ||--o{ LFGPost : "authorId"
  AllTeam |o--o{ LFGPost : "teamId"

LiveStream

Splatoon 3 stream live right now, replaced wholesale on every sync.

Rows typed by LiveStream

ColumnTypeDescription
idGeneratedAlways<number>
platformStreamPlatform
accountstring

Twitch login or YouTube channel id

videoIdstring | null

Id of the live video, null on Twitch where the channel is the stream.

userIdnumber | null → User

User whose Twitch/YouTube connection the account is.

viewerCountnumber
thumbnailUrlstring
Used by 5 repository functions · 47 routes

LiveStreamRepository replaceAllfindByUserIdfindXRankStreams

QStreamsRepository findAllActiveMatchPlayers

TournamentRepository findStreamsByTournamentId

/api/layout/calendar/:id/calendar/new/friends/q/looking/q/match/:id/q/ready/q/streams/refresh-caches/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/streams/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/u/:identifier

Relations (1)
erDiagram
  direction LR
  User |o--o{ LiveStream : "userId"

Log-in links generated via the Lohi Discord bot commands.

Rows typed by LogInLink

ColumnTypeDescription
codestring
expiresAtnumber
userIdnumber → User
Used by 3 repository functions · 2 routes

LogInLinkRepository insertdeleteByCodefindValidByCode

/auth/create-link/auth/login

Relations (1)
erDiagram
  direction LR
  User ||--o{ LogInLink : "userId"

MapPoolMap

One of: - a regular calendar event's map pool (calendarEventId) - a tournament's map pool, organizer picked or the custom pool of a team picked tournament (calendarEventId) - a tournament team's map picks in a team picked tournament (tournamentTeamId), the modes and counts live in Tournament.settings.teamPick

Rows typed by MapPoolMap

ColumnTypeDescription
calendarEventIdnumber | null → CalendarEvent
modeModeShort
stageIdStageId
tournamentTeamIdnumber | null → TournamentTeam
Used by 11 repository functions · 43 routes

CalendarRepository findAllBetweenTwoTimestampsfindByIdinsertupdate

ScrimMapListRepository findMapListsByScrimPostId

TournamentRepository findByIdfindTeamsFullByTournamentIdfindTOSetMapPoolById

TournamentTeamRepository upsertRegistrationupsertCounterpickMapsfindMapPoolsByTeamIds

/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/new/refresh-caches/scrims/:id/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (2)
erDiagram
  direction LR
  CalendarEvent |o--o{ MapPoolMap : "calendarEventId"
  TournamentTeam |o--o{ MapPoolMap : "tournamentTeamId"

MapResult

Denormalized win/loss counts per user, map and season so they are efficient to fetch.

Rows typed by MapResult

ColumnTypeDescription
lossesnumber
modeModeShort
seasonnumber
stageIdStageId
userIdnumber → User
winsnumber
Used by 4 repository functions · 5 routes

PlayerStatRepository upsertMapResultsfindSeasonMapWinrateByUserIdfindSeasonStagesByUserId

TournamentRepository finalize

/q/match/:id/to/:id/brackets/finalize/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic

Relations (1)
erDiagram
  direction LR
  User ||--o{ MapResult : "userId"

ModAuditLog

History of user written public texts, kept for moderators to review

Rows typed by ModAuditLog

ColumnTypeDescription
idGeneratedAlways<number>
type"SENDOUQ_PUBLIC_NOTE"
userIdnumber → User

Author of the text

textstring
createdAtGenerated<number>
Used by 2 repository functions · 2 routes

ModAuditLogRepository insertfindSeasonByUserId

/q/looking/u/:identifier/seasons

Relations (1)
erDiagram
  direction LR
  User ||--o{ ModAuditLog : "userId"

ModNote

Rows typed by ModNote

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
authorIdnumber → User
textstring
createdAtGenerated<number>
isDeletedGenerated<DBBoolean>
Used by 5 repository functions · 2 routes

AdminRepository migrateaddModNotefindModNoteByIddeleteModNote

UserRepository findModInfoById

/admin/u/:identifier/admin

Relations (2)
erDiagram
  direction LR
  User ||--o{ ModNote : "authorId"
  User ||--o{ ModNote : "userId"

Notification

Rows typed by Notification

ColumnTypeDescription
idGeneratedAlways<number>
typeNotificationValue["type"]
metaJSONColumnTypeNullable<Record<string, number | string>>
pictureUrlstring | null
createdAtGenerated<number>
Used by 5 repository functions · 23 routes

NotificationRepository insertfindByUserIdfindAllByTypefindUserIdsWithUnseenByTypedeleteOld

/api/chat/rooms/:id/messages/api/notifications/art/new/badges/:id/edit/calendar/new/friends/notifications/plus/suggestions/new/q/looking/q/preparing/q/ready/scrims/scrims/:id/t/:customUrl/schedule/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/looking/to/:id/matches/:mid/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert/trophies/new

Relations (1)
erDiagram
  direction LR
  Notification ||--o{ NotificationUser : "notificationId"

Referenced by NotificationUser.notificationId

NotificationUser

Rows typed by NotificationUser

ColumnTypeDescription
notificationIdnumber → Notification
userIdnumber → User
seenGenerated<DBBoolean>
Used by 6 repository functions · 33 routes

NotificationRepository insertfindByUserIdmarkAsSeenByTypefindUserIdsWithUnseenByTypemarkOwnAsSeenfindUnseenSubscriptionsByNotificationId

/api/chat/rooms/:id/mentions/seen/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/notifications/art/new/badges/:id/edit/calendar/new/events/friends/notifications/notifications/seen/plus/suggestions/plus/suggestions/new/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/scrims/scrims/:id/t/:customUrl/schedule/to/:id/admin/to/:id/admin/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/looking/to/:id/matches/:mid/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert/trophies/new

Relations (2)
erDiagram
  direction LR
  Notification ||--o{ NotificationUser : "notificationId"
  User ||--o{ NotificationUser : "userId"

NotificationUserSubscription

A subscription of user's browser indicating where push notifications can be sent to.

Rows typed by NotificationUserSubscription

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
subscriptionJSONColumnType<NotificationSubscription>
Used by 4 repository functions · 22 routes

NotificationRepository upsertOwnSubscriptionfindUnseenSubscriptionsByNotificationIdfindAllSubscriptionsByUserIdsdeleteSubscriptionById

/api/chat/rooms/:id/messages/art/new/badges/:id/edit/calendar/new/friends/notifications/subscribe/plus/suggestions/new/q/looking/q/preparing/q/ready/scrims/scrims/:id/t/:customUrl/schedule/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/looking/to/:id/matches/:mid/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert/trophies/new

Relations (1)
erDiagram
  direction LR
  User ||--o{ NotificationUserSubscription : "userId"

PendingTrophy

Rows typed by PendingTrophy

ColumnTypeDescription
idGeneratedAlways<number>
namestring
modelstring
descriptionstring
organizationIdnumber | null → TournamentOrganization
submitterUserIdnumber → User
createdAtnumber
declineReasonstring | null
declinedAtnumber | null
declinedByUserIdnumber | null → User
acceptedAtnumber | null
targetTrophyIdnumber | null → Trophy
managerIdnumber | null → User
creatorIdnumber | null → User
Used by 10 repository functions · 2 routes

AdminRepository migrate

TrophyRepository existsByNamecreatePendingfindPendingByIdallPendingpendingBySubmitterunreviewedCountBySubmitterdeletePendingdeclinePendingaddApproval

/admin/trophies/new

Relations (7)
erDiagram
  direction LR
  User |o--o{ PendingTrophy : "creatorId"
  User |o--o{ PendingTrophy : "declinedByUserId"
  User |o--o{ PendingTrophy : "managerId"
  TournamentOrganization |o--o{ PendingTrophy : "organizationId"
  User ||--o{ PendingTrophy : "submitterUserId"
  Trophy |o--o{ PendingTrophy : "targetTrophyId"
  PendingTrophy ||--o{ PendingTrophyApproval : "pendingTrophyId"

Referenced by PendingTrophyApproval.pendingTrophyId

PendingTrophyApproval

Rows typed by PendingTrophyApproval

ColumnTypeDescription
pendingTrophyIdnumber → PendingTrophy
userIdnumber → User
createdAtnumber
Used by 6 repository functions · 2 routes

AdminRepository migrate

TrophyRepository findPendingByIdallPendingpendingBySubmitterdeclinePendingaddApproval

/admin/trophies/new

Relations (2)
erDiagram
  direction LR
  PendingTrophy ||--o{ PendingTrophyApproval : "pendingTrophyId"
  User ||--o{ PendingTrophyApproval : "userId"

PlayerResult

Denormalized head-to-head results between two users per season so they are efficient to fetch.

Rows typed by PlayerResult

ColumnTypeDescription
mapLossesnumber
mapWinsnumber
otherUserIdnumber → User
ownerUserIdnumber → User
seasonnumber
setLossesnumber
setWinsnumber
type"MATE" | "ENEMY"

Was otherUserId on the same team as ownerUserId for these results?

Used by 4 repository functions · 5 routes

PlayerStatRepository findSeasonSetWinrateByUserIdfindSeasonMatesEnemiesByUserIdupsertPlayerResults

TournamentRepository finalize

/q/match/:id/to/:id/brackets/finalize/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic

Relations (2)
erDiagram
  direction LR
  User ||--o{ PlayerResult : "otherUserId"
  User ||--o{ PlayerResult : "ownerUserId"

PlusSuggestion

Comments to a suggestion are also stored as suggestions, same as the suggestion itself.

Rows typed by PlusSuggestion

ColumnTypeDescription
authorIdnumber → User
createdAtGenerated<number>
idGeneratedAlways<number>
monthnumber
suggestedIdnumber → User
textstring
tiernumber
updatedAtnumber | null
yearnumber
Used by 6 repository functions · 4 routes

PlusSuggestionRepository findAllByMonthfindMonthSummaryinsertupdateTextByIddeleteByIddeleteWithCommentsBySuggestedUserId

/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting

Relations (2)
erDiagram
  direction LR
  User ||--o{ PlusSuggestion : "authorId"
  User ||--o{ PlusSuggestion : "suggestedId"

PlusTier

Result of the latest voting (PlusVoting.computeFreshPlusTiers) with players from the leaderboard added, materialized for performance.

Rows typed by PlusTier

ColumnTypeDescription
tiernumber
userIdnumber → User
Used by 25 repository functions · 41 routes

AdminRepository replacePlusTiers

AssociationRepository findByMemberUserId

BuildRepository insertupdatefindPageByWeaponIdrecalculateAllSortValues

LFGRepository findBoardPagefindVisibleByIdfindAllOwnfindByAuthorUserIdfindAllVisibleParticipantIds

PlusSuggestionRepository findAllByMonthfindMonthSummary

PlusVotingRepository findAllUsersForVoting

TournamentLFGRepository findLookingTeamsByTournamentIdfindSubGroups

UserCardRepository findAllByUserIdsfindAllByUserIdsCached

UserRepository findPlusTiersByUserIdsfindLayoutDataByIdfindProfileByUserIdfindLeanByIdfindAllPlusServerMemberssearchsearchExact

//admin/api/layout/associations/builds/:slug/friends/leaderboards/lfg/lfg/new/plus/list/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/q/looking/q/match/:id/q/preparing/q/ready/q/streams/scrims/scrims/:id/scrims/new/search/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/join/to/:id/looking/to/:id/matches/:mid/to/:id/register/to/:id/streams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert/trophies/:id/wins/:userId/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/builds/new/u/:identifier/edit/user-card/edit/user-report/:id/user/:identifier

Relations (1)
erDiagram
  direction LR
  User |o--o| PlusTier : "userId"

PlusVote

Rows typed by PlusVote

ColumnTypeDescription
authorIdnumber → User
monthnumber
scorenumber
tiernumber
becomesValidAtnumber

When the vote stops being secret and starts counting towards the results i.e. the end of the voting range.

votedIdnumber → User
yearnumber
Used by 3 repository functions · 2 routes

PlusVotingRepository findAllPlusTiersFromLatestVotinghasVotedupsertMany

/admin/plus/voting

Relations (2)
erDiagram
  direction LR
  User ||--o{ PlusVote : "authorId"
  User ||--o{ PlusVote : "votedId"

PlusVotingResult

VIEW, read-only. PlusVote rows aggregated per (votedId, tier, month, year) with the average score.

View of PlusSuggestion, PlusVote

Rows typed by PlusVotingResult

ColumnTypeDescription
votedIdnumber
tiernumber
scorenumber
monthnumber
yearnumber
wasSuggestedDBBoolean
Used by 2 repository functions · 2 routes

PlusVotingRepository findAllPlusTiersFromLatestVotingfindResultsByMonthYear

/admin/plus/voting/results

PrivateUserNote

Rows typed by PrivateUserNote

ColumnTypeDescription
authorIdnumber → User
targetIdnumber → User
textstring | null
sentiment"POSITIVE" | "NEUTRAL" | "NEGATIVE"
updatedAtGenerated<number>
Used by 5 repository functions · 17 routes

PrivateUserNoteRepository findAllOwnupsertOwnNotedeleteOwnNoteById

UserCardRepository findAllByUserIdsfindAllByUserIdsCached

/lfg/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/scrims/scrims/:id/to/:id/admin/seeds/to/:id/looking/to/:id/matches/:mid/to/:id/streams/trophies/:id/wins/:userId/u/:identifier/user-card/:id/note/user-card/edit

Relations (2)
erDiagram
  direction LR
  User ||--o{ PrivateUserNote : "authorId"
  User ||--o{ PrivateUserNote : "targetId"

ReportedWeapon

Rows typed by ReportedWeapon

ColumnTypeDescription
groupMatchIdnumber | null → GroupMatch
tournamentMatchIdnumber | null → TournamentMatch
mapIndexnumber
userIdnumber → User
weaponSplIdMainWeaponId
createdAtGenerated<number>
ingestedMatchIdnumber | null → IngestedMatch

the scanner read this weapon was reported from, null when reported by hand

Used by 16 repository functions · 26 routes

LeaderboardRepository findSeasonPopularUsersWeapon

ScannerIngestRepository addLinksdeleteUnlinkedMatchesCreatedBefore

ReportedWeaponRepository upsertOwnreplaceByMatchIddeleteByMatchIddeleteOwnByMapIndexdeleteByMapIndexfindByMatchIdupsertOwnTournamentdeleteOwnByMapIndexTournamentdeleteExtraByTournamentMatchIdfindByTournamentMatchIdfindSeasonReportedWeaponsByUserIdfindAllWeaponUsageStats

TrophyRepository findWinsByOwner

//api/layout/friends/ingest/leaderboards/lfg/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/scrims/scrims/:id/to/:id/admin/seeds/to/:id/looking/to/:id/matches/:mid/to/:id/streams/to/:id/teams/:tid/comps/trophies/:id/wins/:userId/u/:identifier/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user-card/edit/weapon-usage

Relations (4)
erDiagram
  direction LR
  GroupMatch |o--o{ ReportedWeapon : "groupMatchId"
  IngestedMatch |o--o{ ReportedWeapon : "ingestedMatchId"
  TournamentMatch |o--o{ ReportedWeapon : "tournamentMatchId"
  User ||--o{ ReportedWeapon : "userId"

SavedCalendarEvent

Rows typed by SavedCalendarEvent

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
calendarEventIdnumber → CalendarEvent
createdAtGenerated<number>
Used by 6 repository functions · 5 routes

SavedCalendarEventRepository saveOwnunsaveByUserIdisSavedcountByUserIdfindAllUpcomingByUserIddeleteByTournamentId

/api/layout/events/to/:id/brackets/finalize/to/:id/info/to/:id/register

Relations (2)
erDiagram
  direction LR
  CalendarEvent ||--o{ SavedCalendarEvent : "calendarEventId"
  User ||--o{ SavedCalendarEvent : "userId"

ScrimMap

Rows typed by ScrimMap

ColumnTypeDescription
idGeneratedAlways<number>
scrimPostIdnumber → ScrimPost
indexnumber
modeModeShort
stageIdStageId
winnerSide"ALPHA" | "BRAVO" | null
reportedAtnumber | null
reportedByUserIdnumber | null → User
Used by 5 repository functions · 1 route

ScrimMapRepository reportMapAndGenerateNextundoMostRecentMapreplaceCurrentMapfindMapsByScrimPostIdtryGenerateAndInsertNextMap

/scrims/:id

Relations (2)
erDiagram
  direction LR
  User |o--o{ ScrimMap : "reportedByUserId"
  ScrimPost ||--o{ ScrimMap : "scrimPostId"

ScrimMapList

Rows typed by ScrimMapList

ColumnTypeDescription
idGeneratedAlways<number>
scrimPostIdnumber → ScrimPost
side"ALPHA" | "BRAVO"
source"TOURNAMENT" | "POOL"
tournamentIdnumber | null → Tournament
serializedPoolstring | null
updatedAtnumber
Used by 3 repository functions · 1 route

ScrimMapListRepository submitMapListAndGenerateIfNeededdeleteMapListfindMapListsByScrimPostId

/scrims/:id

Relations (2)
erDiagram
  direction LR
  ScrimPost ||--o{ ScrimMapList : "scrimPostId"
  Tournament |o--o{ ScrimMapList : "tournamentId"

ScrimPickupRoster

Rows typed by ScrimPickupRoster

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber → User
usedAtGenerated<number>

When the roster was last used to make a scrim post

Used by 3 repository functions · 1 route

ScrimPickupRosterRepository findAllOwnRecentupsertOwndeleteOld

/scrims/new

Relations (2)
erDiagram
  direction LR
  User ||--o{ ScrimPickupRoster : "userId"
  ScrimPickupRoster ||--o{ ScrimPickupRosterUser : "scrimPickupRosterId"

Referenced by ScrimPickupRosterUser.scrimPickupRosterId

ScrimPickupRosterUser

Rows typed by ScrimPickupRosterUser

ColumnTypeDescription
scrimPickupRosterIdnumber → ScrimPickupRoster
userIdnumber → User

Member of the pick-up roster, excluding the roster's owner

Used by 2 repository functions · 1 route

ScrimPickupRosterRepository findAllOwnRecentupsertOwn

/scrims/new

Relations (2)
erDiagram
  direction LR
  ScrimPickupRoster ||--o{ ScrimPickupRosterUser : "scrimPickupRosterId"
  User ||--o{ ScrimPickupRosterUser : "userId"

ScrimPost

Rows typed by ScrimPost

ColumnTypeDescription
idGeneratedAlways<number>
startsAtnumber
rangeEndsAtnumber | null

Optional end of time range indicating team accepts scrims starting between startsAt and rangeEndsAt

maxDivnumber | null

Highest LUTI div accepted

minDivnumber | null

Lowest LUTI div accepted

visibilityJSONColumnTypeNullable<AssociationVisibility>
textstring | null
chatRoomIdnumber | null → ChatRoom
teamIdnumber | null → AllTeam

Refers to the team looking for the team (can also be a pick-up)

managedByAnyoneDBBoolean
canceledAtnumber | null
canceledByUserIdnumber | null → User
cancelReasonstring | null
isScheduledForFutureGenerated<DBBoolean>

When the post was made was it scheduled for a future time slot (as opposed to looking now)

maps"SZ" | "ALL" | "RANKED" | null

Maps/modes the scrim is available for. If null means no preference unless "mapsTournamentId" is set

mapsTournamentIdnumber | null → Tournament

If set, specifies the maps of a tournament to play

createdAtGenerated<number>
updatedAtGenerated<number>
Used by 12 repository functions · 21 routes

ChatRepository findAllOpenRoomIdsByUserId

ScrimPostRepository insertdeleteByIdfindAllByChatRoomIdsfindByIdfindAllRelevantacceptRequestcancelScrimfindAcceptedScrimsBetweenTwoTimestampsfindAllAcceptedByUserIdsfindPendingOverlapsForUsersfindUserScrims

/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/events/friends/q/looking/q/match/:id/scrims/scrims/:id/scrims/new/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/admin/to/:id/admin/to/:id/matches/:mid/to/:id/register

Relations (8)
erDiagram
  direction LR
  User |o--o{ ScrimPost : "canceledByUserId"
  ChatRoom |o--o| ScrimPost : "chatRoomId"
  Tournament |o--o{ ScrimPost : "mapsTournamentId"
  AllTeam |o--o{ ScrimPost : "teamId"
  ScrimPost ||--o{ ScrimMap : "scrimPostId"
  ScrimPost ||--o{ ScrimMapList : "scrimPostId"
  ScrimPost ||--o{ ScrimPostRequest : "scrimPostId"
  ScrimPost ||--o{ ScrimPostUser : "scrimPostId"

Referenced by ScrimMap.scrimPostId, ScrimMapList.scrimPostId, ScrimPostRequest.scrimPostId, ScrimPostUser.scrimPostId

ScrimPostRequest

Rows typed by ScrimPostRequest

ColumnTypeDescription
idGeneratedAlways<number>
scrimPostIdnumber → ScrimPost
teamIdnumber | null → AllTeam
messagestring | null
startsAtnumber | null

Specific time selected by requester (required when post has rangeEndsAt)

isAcceptedGenerated<DBBoolean>
createdAtGenerated<number>
Used by 11 repository functions · 21 routes

ChatRepository findAllOpenRoomIdsByUserId

ScrimPostRepository insertRequestfindAllByChatRoomIdsfindByIdfindAllRelevantacceptRequestdeleteRequestfindAcceptedScrimsBetweenTwoTimestampsfindAllAcceptedByUserIdsfindPendingOverlapsForUsersfindUserScrims

/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/events/friends/q/looking/q/match/:id/scrims/scrims/:id/scrims/new/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/admin/to/:id/admin/to/:id/matches/:mid/to/:id/register

Relations (3)
erDiagram
  direction LR
  ScrimPost ||--o{ ScrimPostRequest : "scrimPostId"
  AllTeam |o--o{ ScrimPostRequest : "teamId"
  ScrimPostRequest ||--o{ ScrimPostRequestUser : "scrimPostRequestId"

Referenced by ScrimPostRequestUser.scrimPostRequestId

ScrimPostRequestUser

Rows typed by ScrimPostRequestUser

ColumnTypeDescription
scrimPostRequestIdnumber → ScrimPostRequest
userIdnumber → User
isOwnerDBBoolean
Used by 9 repository functions · 21 routes

ChatRepository findAllOpenRoomIdsByUserId

ScrimPostRepository insertRequestfindAllByChatRoomIdsfindByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindAllAcceptedByUserIdsfindPendingOverlapsForUsersfindUserScrims

/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/events/friends/q/looking/q/match/:id/scrims/scrims/:id/scrims/new/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/admin/to/:id/admin/to/:id/matches/:mid/to/:id/register

Relations (2)
erDiagram
  direction LR
  ScrimPostRequest ||--o{ ScrimPostRequestUser : "scrimPostRequestId"
  User ||--o{ ScrimPostRequestUser : "userId"

ScrimPostUser

Rows typed by ScrimPostUser

ColumnTypeDescription
scrimPostIdnumber → ScrimPost
userIdnumber → User
isOwnerDBBoolean
Used by 9 repository functions · 21 routes

ChatRepository findAllOpenRoomIdsByUserId

ScrimPostRepository insertfindAllByChatRoomIdsfindByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindAllAcceptedByUserIdsfindPendingOverlapsForUsersfindUserScrims

/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/events/friends/q/looking/q/match/:id/scrims/scrims/:id/scrims/new/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/admin/to/:id/admin/to/:id/matches/:mid/to/:id/register

Relations (2)
erDiagram
  direction LR
  ScrimPost ||--o{ ScrimPostUser : "scrimPostId"
  User ||--o{ ScrimPostUser : "userId"

SeedingSkill

Used for tournament auto-seeding. Calculates off tournament matches same as SP but does not have seasonal resets.

Rows typed by SeedingSkill

ColumnTypeDescription
munumber
ordinalnumber
sigmanumber
userIdnumber → User
type"RANKED" | "UNRANKED"
Used by 4 repository functions · 39 routes

SkillRepository findSeedingSkills

TournamentRepository findByIdfindTeamsFullByTournamentIdfinalize

/calendar/:id/calendar/new/refresh-caches/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (1)
erDiagram
  direction LR
  User ||--o{ SeedingSkill : "userId"

Skill

Rows typed by Skill

ColumnTypeDescription
groupMatchIdnumber | null → GroupMatch
idGeneratedAlways<number>
identifierSkillTeamIdentifier | null

Set for team ratings, null for the solo ratings identified by userId instead.

matchesCountnumber
munumber
ordinalnumber
sigmanumber
seasonnumber
tournamentIdnumber | null → Tournament
userIdnumber | null → User
createdAtnumber | null

Can be null because we did not always save this.

Used by 37 repository functions · 38 routes

LeaderboardRepository findTeamLeaderboardBySeasonfindSeasonsParticipatedInByUserIdfindUserSPLeaderboard

LiveStreamRepository findXRankStreams

SkillRepository findCurrentUserSkillsfindCurrentTeamSkillsfindOrderedUserOrdinalsBySeasonexistsBySeasonaddInitialSkillfindSeasonProgressionByUserIdfindSeasonPeakOrdinalByUserIdfindSeasonActiveDaysByUserId

SQGroupRepository findAllMapModePreferencesBySeasonNth

MatchSkillRepository insertMatchSkills

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserIdfindSeasonTournamentPlacementsByUserIdfindSeasonTournamentRunsByUserId

SQMatchRepository findLiveStateByIdfindByIdcountSeasonResultPagesByUserIdfindSeasonResultsByUserIdfindSeasonDaySummariesByUserIdfindSeasonCanceledMatchesByUserIdfindCancelNominationCountsByUserIdscancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerfindUnfinishedMatchesCreatedBeforeresolveUnfinishedMatchundoMatchReportundoMapReport

TournamentRepository reopenTournamentfinalize

//admin/api/layout/api/status/friends/leaderboards/lfg/plus/suggestions/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/refresh-caches/scrims/scrims/:id/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/tiers/to/:id/admin/brackets/to/:id/admin/seeds/to/:id/brackets/finalize/to/:id/looking/to/:id/matches/:mid/to/:id/streams/trophies/:id/wins/:userId/u/:identifier/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user-card/edit/user/:identifier/user/:userId/active-match

Relations (4)
erDiagram
  direction LR
  GroupMatch |o--o{ Skill : "groupMatchId"
  Tournament |o--o{ Skill : "tournamentId"
  User |o--o{ Skill : "userId"
  Skill ||--o{ SkillTeamUser : "skillId"

Referenced by SkillTeamUser.skillId

SkillTeamUser

Rows typed by SkillTeamUser

ColumnTypeDescription
skillIdnumber → Skill
userIdnumber → User
Used by 4 repository functions · 7 routes

LeaderboardRepository findTeamLeaderboardBySeason

MatchSkillRepository insertMatchSkills

SQMatchRepository findSeasonResultsByUserId

TournamentRepository finalize

//leaderboards/q/match/:id/to/:id/brackets/finalize/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/summary-graphic

Relations (2)
erDiagram
  direction LR
  Skill ||--o{ SkillTeamUser : "skillId"
  User ||--o{ SkillTeamUser : "userId"

SpecialTrophyOwner

Rows typed by SpecialTrophyOwner

ColumnTypeDescription
trophyIdnumber → Trophy
userIdnumber → User
createdAtnumber
Used by 6 repository functions · 7 routes

AdminRepository migrate

TrophyRepository findByOwnerUserIdfindByOwnerUserIdIncludingHiddenfindByIdfindXpWeaponCountsByIdsyncSpecialTrophies

/admin/player/:id/trophies/:id/trophies/:id/backfill/:seriesId/trophies/new/u/:identifier/u/:identifier/edit

Relations (2)
erDiagram
  direction LR
  Trophy ||--o{ SpecialTrophyOwner : "trophyId"
  User ||--o{ SpecialTrophyOwner : "userId"

SplatoonPlayer

Rows typed by SplatoonPlayer

ColumnTypeDescription
idGeneratedAlways<number>
splIdstring
userIdnumber | null → User
peakXpJSONColumnTypeNullable<PeakXP>

Players best XP across both divisions. Denormalized for performance.

Used by 26 repository functions · 26 routes

AdminRepository linkUserAndPlayer

BadgeRepository syncXPBadges

BuildRepository insertupdaterecalculateAllSortValues

LeaderboardRepository findAllXPLeaderboardfindModeXPLeaderboardfindWeaponXPLeaderboard

LiveStreamRepository findXRankStreams

XRankPlacementRepository insertManyunlinkPlayerByUserIdisPlayerLinkedByUserIdfindPeakVerifiedXpByUserIdfindPlacementsOfMonthfindPlacementsByPlayerIdfindPlacementsByUserIdfindPeaksByUserIdrefreshAllPeakXprefreshTenStarWeapons

TrophyRepository findByOwnerUserIdfindByOwnerUserIdIncludingHiddenfindXpWeaponCountsByIdsyncSpecialTrophies

UserCardRepository findAllByUserIdsfindAllByUserIdsCachedfindVerifiedXpByUserId

/admin/api/layout/leaderboards/lfg/player/:id/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/scrims/scrims/:id/to/:id/admin/seeds/to/:id/looking/to/:id/matches/:mid/to/:id/streams/trophies/:id/trophies/:id/placements/:userId/trophies/:id/wins/:userId/u/:identifier/u/:identifier/builds/new/u/:identifier/edit/user-card/edit/user/:identifier/xsearch

Relations (2)
erDiagram
  direction LR
  User |o--o| SplatoonPlayer : "userId"
  SplatoonPlayer ||--o{ XRankPlacement : "playerId"

Referenced by XRankPlacement.playerId

SplatoonRotation

Rows typed by SplatoonRotation

ColumnTypeDescription
idGeneratedAlways<number>
typeSplatoonRotationType
modeRankedModeShort
stageId1number
stageId2number
startsAtnumber
endsAtnumber
Used by 2 repository functions · 1 route

SplatoonRotationRepository replaceAllfindAll

/

TaggedArt

Rows typed by TaggedArt

ColumnTypeDescription
artIdnumber → Art
tagIdnumber → ArtTag
Used by 5 repository functions · 4 routes

ArtRepository findShowcaseArtsByTagdeleteOrphanTagsfindArtsByUserIdinsertupdate

/art/art/new/u/:identifier/u/:identifier/art

Relations (2)
erDiagram
  direction LR
  Art ||--o{ TaggedArt : "artId"
  ArtTag ||--o{ TaggedArt : "tagId"

Team

VIEW over AllTeam, excludes soft-deleted teams. Insert/update via AllTeam.

View of AllTeam

Rows typed by Team

ColumnTypeDescription
avatarImgIdnumber | null
bannerImgIdnumber | null
biostring | null
createdAtGenerated<number>
customUrlstring
customThemeJSONColumnTypeNullable<CustomTheme>
deletedAtnumber | null

Soft delete marker. Always null when selected via the Team view, which filters these rows out.

idGeneratedAlways<number>
inviteCodestring
namestring
bskystring | null
mapModePreferencesJSONColumnTypeNullable<UserMapModePreferences>
tagstring | null

Shown in-game in front of members' names

Used by 32 repository functions · 109 routes

AvailabilityRepository findAllUpcomingTeamEventsByUserId

ImageRepository countAllUnvalidatedfindAllUnvalidatedcountUnvalidatedBySubmitterUserId

LeaderboardRepository findTeamLeaderboardBySeason

LFGRepository findBoardPagefindVisibleByIdfindAllOwn

ScrimPostRepository findByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindPendingOverlapsForUsersfindUserScrims

SQGroupRepository insertFromPrevioussyncTeamIdmorphGroupsinsertMemberfindFriendsAndTeammatesleaveGroup

TeamRepository searchByNamefindAllMemberOfByUserIdfindByCustomUrlfindAllByMemberUserIdupdateupdateMapModePreferencesswitchOwnMainTeamdeleteByIdinsertOwnMembershiphandleMemberLeavingupdateRoster

UserRepository findProfileByUserIdfindLeanById

//admin/admin/streams/admin/voice/api/api/chat/rooms/:id/mentions/seen/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/telemetry/api/voice/webhook/art/new/associations/associations/new/auth/auth/create-link/auth/impersonate/auth/impersonate/stop/auth/logout/auth/refresh/badges/:id/edit/calendar/calendar/:id/calendar/:id/report-winners/calendar/new/end-season/events/friends/friends-for-adding/ingest/leaderboards/lfg/lfg/new/notifications/seen/notifications/subscribe/org/:slug/org/:slug/edit/org/new/patrons/player/:id/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/run-routine/scrims/scrims/:id/scrims/new/search/seed/set-plus-voting-active/settings/sidenav/sse/:connectionId/topics/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/team/:id/theme/to/:id/admin/to/:id/admin/to/:id/admin/brackets/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/:mid/to/:id/register/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/new/u/:identifier/u/:identifier/admin/u/:identifier/art/u/:identifier/builds/u/:identifier/builds/new/u/:identifier/edit/u/:identifier/edit-widgets/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/summary-graphic/upload/admin/user-card/:id/note/user-card/edit/user-report/:id/user/:identifier/vods/:id/vods/new

TeamEvent

Something the team does together that is not a tournament or a scrim, e.g. a VoD review. Blocks the members' availability.

Rows typed by TeamEvent

ColumnTypeDescription
idGeneratedAlways<number>
teamIdnumber → AllTeam
authorIdnumber | null → User

User who created the event. Null if their account has since been deleted.

namestring
startsAtnumber
endsAtnumber
createdAtGenerated<number>
Used by 8 repository functions · 8 routes

AvailabilityRepository findAllTeamEventsByUserIdsfindTeamEventsByTeamIdfindAllUpcomingTeamEventsByUserIdfindTeamEventByIddeleteTeamEventsEndedBeforeinsertTeamEventupdateTeamEventdeleteTeamEvent

/api/layout/events/friends/scrims/scrims/new/t/:customUrl/schedule/to/:id/matches/:mid/to/:id/register

Relations (3)
erDiagram
  direction LR
  User |o--o{ TeamEvent : "authorId"
  AllTeam ||--o{ TeamEvent : "teamId"
  TeamEvent ||--o{ TeamEventMember : "teamEventId"

Referenced by TeamEventMember.teamEventId

TeamEventMember

Participant of a team event limited to selected members. No rows for an event = the whole team takes part.

Rows typed by TeamEventMember

ColumnTypeDescription
teamEventIdnumber → TeamEvent
userIdnumber → User
Used by 5 repository functions · 8 routes

AvailabilityRepository findAllTeamEventsByUserIdsfindTeamEventsByTeamIdfindAllUpcomingTeamEventsByUserIdinsertTeamEventupdateTeamEvent

/api/layout/events/friends/scrims/scrims/new/t/:customUrl/schedule/to/:id/matches/:mid/to/:id/register

Relations (2)
erDiagram
  direction LR
  TeamEvent ||--o{ TeamEventMember : "teamEventId"
  User ||--o{ TeamEventMember : "userId"

TeamMember

VIEW over AllTeamMember, excludes members who have left, members of deleted teams, and members whose secondary team this is. Insert/update via AllTeamMember.

View of AllTeamMember, Team

Rows typed by TeamMember

ColumnTypeDescription
createdAtGenerated<number>
isOwnerGenerated<DBBoolean>
isManagerGenerated<DBBoolean>
leftAtnumber | null

Always null when selected via the TeamMember or TeamMemberWithSecondary views, which filter these rows out.

roleMemberRole | null
customRolestring | null
roleTypeMemberRoleType | null

If customRole is defined, this classifies how the role should be treated

orderGenerated<number>

User-defined ordering of members within a team (ascending)

teamIdnumber
userIdnumber
isMainTeamGenerated<DBBoolean>
Used by 3 repository functions · 13 routes

AdminRepository migrate

TeamRepository deleteById

UserRepository findLeanById

/admin/plus/suggestions/new/q/preparing/scrims/scrims/new/t/:customUrl/to/:id/admin/registration/:tid?/to/:id/join/to/:id/looking/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert/user-report/:id

TeamMemberWithSecondary

VIEW over AllTeamMember, same as TeamMember but also includes rows where this is the member's secondary (i.e. non-main) team. Insert/update via AllTeamMember.

View of AllTeamMember, Team

Rows typed by TeamMember

ColumnTypeDescription
createdAtGenerated<number>
isOwnerGenerated<DBBoolean>
isManagerGenerated<DBBoolean>
leftAtnumber | null

Always null when selected via the TeamMember or TeamMemberWithSecondary views, which filter these rows out.

roleMemberRole | null
customRolestring | null
roleTypeMemberRoleType | null

If customRole is defined, this classifies how the role should be treated

orderGenerated<number>

User-defined ordering of members within a team (ascending)

teamIdnumber
userIdnumber
isMainTeamGenerated<DBBoolean>
Used by 21 repository functions · 27 routes

AvailabilityRepository findScheduleVisibleUserIdsfindWeekReminderUserIdsfindAllTeamEventsByUserIdsfindAllUpcomingTeamEventsByUserId

FriendRepository findByUserIdWithActivity

LeaderboardRepository findTeamLeaderboardBySeason

LFGRepository findBoardPagefindVisibleByIdfindAllOwnfindAllVisibleParticipantIds

SQGroupRepository findFriendsAndTeammates

TeamRepository searchByNamefindAllMemberOfByUserIdfindByCustomUrlfindAllByMemberUserIdswitchOwnMainTeamdeleteByIdinsertOwnMembershiphandleMemberLeavingupdateRoster

UserRepository findProfileByUserId

//api/layout/events/friends/friends-for-adding/leaderboards/lfg/lfg/new/q/preparing/scrims/scrims/new/search/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/to/:id/matches/:mid/to/:id/register/u/:identifier/u/:identifier/edit/u/:identifier/seasons/u/:identifier/seasons/summary-graphic/user/:identifier

TenStarWeapon

Rows typed by TenStarWeapon

ColumnTypeDescription
userIdnumber → User
weaponSplIdMainWeaponId
Used by 20 repository functions · 33 routes

LFGRepository findBoardPagefindVisibleByIdfindAllOwn

MatchProfileRepository findSettingsByUserIdfindWeaponPoolByUserId

SQGroupRepository findCurrentGroups

SQMatchRepository findByIdcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

TeamRepository findByCustomUrl

XRankPlacementRepository findTenStarWeaponSplIdsByUserIdrefreshTenStarWeapons

TournamentLFGRepository findLookingTeamsByTournamentIdfindSubGroups

//admin/analyzer/api/layout/api/status/builds/friends/lfg/lfg/new/object-damage-calculator/player/:id/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/to/:id/looking/to/:id/matches/:mid/u/:identifier/user/:userId/active-match

Relations (1)
erDiagram
  direction LR
  User ||--o{ TenStarWeapon : "userId"

Tournament

The bracket tables (TournamentStage, TournamentGroup, TournamentRound, TournamentMatch) mimic the [brackets-manager.js schema](https://github.com/Drarig29/brackets-manager.js/issues/111#issuecomment-997417423).

Rows typed by Tournament

ColumnTypeDescription
settingsJSONColumnType<TournamentSettings>
idGeneratedAlways<number>
mapPickingStyleTournamentMapPickingStyle
preparedMapsJSONColumnTypeNullable<(PreparedMaps | null)[]>

Maps prepared ahead of time for rounds. Follows settings.bracketProgression order. Null in the spot if not defined yet for that bracket.

castAccountsJSONColumnTypeNullable<CastAccount[]>
castedMatchesInfoJSONColumnTypeNullable<CastedMatchesInfo>
rulesstring | null
isFinalizedGenerated<DBBoolean>

Is the tournament finalized meaning all the matches are played and TO has locked it making it read-only

seedingSnapshotJSONColumnTypeNullable<SeedingSnapshot>

Snapshot of teams and rosters when seeds were last saved. Used to detect NEW teams/players.

tierTournamentTierNumber | null

Tournament tier based on top teams' skill. 1=X, 2=S+, 3=S, 4=A+, 5=A, 6=B+, 7=B, 8=C+, 9=C

vodsLastSyncAtGenerated<number | null>
vodsSyncCountGenerated<number>

How many times vods have been synced (automatic process that happens when tournament has concluded).

Used by 62 repository functions · 92 routes

CalendarRepository findAllBetweenTwoTimestampsfindByIdfindRecentTournamentsByOrganizerUserIdinsertupdate

FriendRepository findByUserIdWithActivity

LeaderboardRepository findSeasonPopularUsersWeapon

SkillRepository findSeasonProgressionByUserIdfindSeasonActiveDaysByUserId

ScannerIngestRepository castedGamesInTournament

ScrimMapListRepository findMapListsByScrimPostId

PlayerStatRepository findSeasonTournamentRunsByUserId

ReportedWeaponRepository findSeasonReportedWeaponsByUserId

TeamRepository findResultsById

TournamentRepository findByIdfindStreamsByTournamentIdfindTeamsFullByTournamentIdfindRulesByIdfindSeedingSnapshotByIdfindLatestFinalizedLeagueParticipantsfindPreparedMapsByIdfindRelatedUsersByTournamentIdsfindAllForShowcasefindShowcaseCountsByIdfindAllBetweenTwoTimestampsfindPendingCheckInsStartingBetweenupdateProgressionupsertPreparedMapsupdateCastAccountslockMatchunlockMatchsetMatchAsCastedreopenTournamentfinalizefinalizeWithoutSummarysearchByNameupdateTeamSeedsupsertDivisionTierfindRunningTournamentIds

TournamentTeamRepository findAllByChatRoomIdsupdateOwnMemberInGameNameForNonStartedinsertupsertRegistrationjoinfindAllRegistrationsByUserIds

TournamentMatchVodRepository findTournamentsNeedingVodSyncmarkVodSyncCompletedfindCastedMatchHistoryByTournamentId

TournamentMatchRepository findMatchById

TournamentOrganizationRepository findAllUnfinalizedEventscountActiveParticipantsupdate

TrophyRepository allfindByOrganizationIdfindTournamentsByTrophyIdfindWinsByOwnerfindAllBackfillableTournamentsinsertTournamentOwnersbackfill

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserId

//admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/webhook/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/:year/:week/calendar/new/events/friends/ingest/leaderboards/lfg/org/:slug/org/:slug/edit/org/:slug/stats/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/refresh-caches/scrims/scrims/:id/scrims/new/search/seed/sse/:connectionId/topics/t/:customUrl/results/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/to/search/tournament-match/:id/tournament/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/casted/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/streams/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/tournaments/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/edit/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user-card/edit

Relations (16)
erDiagram
  direction LR
  Tournament |o--o{ CalendarEvent : "tournamentId"
  Tournament |o--o{ IngestedMatch : "tournamentIdHint"
  Tournament |o--o{ ScrimMapList : "tournamentId"
  Tournament |o--o{ ScrimPost : "mapsTournamentId"
  Tournament |o--o{ Skill : "tournamentId"
  Tournament ||--o{ TournamentAuditLog : "tournamentId"
  Tournament |o--o{ TournamentBadgeOwner : "tournamentId"
  Tournament ||--o{ TournamentBracketProgressionOverride : "tournamentId"
  Tournament ||--o{ TournamentDivisionTier : "tournamentId"
  Tournament ||--o{ TournamentResult : "tournamentId"
  Tournament ||--o{ TournamentStaff : "tournamentId"
  Tournament ||--o{ TournamentStage : "tournamentId"
  Tournament ||--o{ TournamentStreamer : "tournamentId"
  Tournament ||--o{ TournamentTeam : "tournamentId"
  Tournament ||--o{ TournamentTeamHistory : "tournamentId"
  Tournament ||--o{ TrophyOwner : "tournamentId"

Referenced by CalendarEvent.tournamentId, IngestedMatch.tournamentIdHint, ScrimMapList.tournamentId, ScrimPost.mapsTournamentId, Skill.tournamentId, TournamentAuditLog.tournamentId, TournamentBadgeOwner.tournamentId, TournamentBracketProgressionOverride.tournamentId, TournamentDivisionTier.tournamentId, TournamentResult.tournamentId, TournamentStaff.tournamentId, TournamentStage.tournamentId, TournamentStreamer.tournamentId, TournamentTeam.tournamentId, TournamentTeamHistory.tournamentId, TrophyOwner.tournamentId

TournamentAuditLog

Rows typed by TournamentAuditLog

ColumnTypeDescription
idGeneratedAlways<number>
tournamentIdnumber → Tournament
typeTournamentAuditLogType
actorUserIdnumber → User
subjectUserIdnumber | null → User

The affected member, for member-level events. null for team-level events.

tournamentTeamHistoryIdnumber | null → TournamentTeamHistory

References {@link TournamentTeamHistory.id} so the team name stays resolvable after the team is hard-deleted.

metadataJSONColumnTypeNullable<TournamentAuditLogMetadata>
createdAtGenerated<number>
Used by 4 repository functions · 11 routes

TournamentAuditLogRepository insertfindByTournamentIdcountByTournamentIddeleteOld

/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/join/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (4)
erDiagram
  direction LR
  User ||--o{ TournamentAuditLog : "actorUserId"
  User |o--o{ TournamentAuditLog : "subjectUserId"
  Tournament ||--o{ TournamentAuditLog : "tournamentId"
  TournamentTeamHistory |o--o{ TournamentAuditLog : "tournamentTeamHistoryId"

TournamentBadgeOwner

Rows typed by TournamentBadgeOwner

ColumnTypeDescription
badgeIdnumber → Badge
userIdnumber → User
tournamentIdnumber | null → Tournament

Which tournament the badge is from, if null was added manually by a badge manager as opposed to once a tournament was finalized.

countGenerated<number>

How many times this badge was awarded to this user from this source. Tournament rows are always 1; manual grants aggregate repeat awards here.

Used by 5 repository functions · 5 routes

AdminRepository migrate

BadgeRepository replaceOwnerssyncXPBadges

TournamentRepository reopenTournamentfinalize

/admin/badges/:id/edit/player/:id/to/:id/admin/brackets/to/:id/brackets/finalize

Relations (3)
erDiagram
  direction LR
  Badge ||--o{ TournamentBadgeOwner : "badgeId"
  Tournament |o--o{ TournamentBadgeOwner : "tournamentId"
  User ||--o{ TournamentBadgeOwner : "userId"

TournamentBracketProgressionOverride

Rows typed by TournamentBracketProgressionOverride

ColumnTypeDescription
sourceBracketIdxnumber
destinationBracketIdxnumber
tournamentTeamIdnumber → TournamentTeam
tournamentIdnumber → Tournament
Used by 2 repository functions · 39 routes

TournamentRepository findByIdoverrideTeamBracketProgression

/calendar/:id/calendar/new/refresh-caches/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (2)
erDiagram
  direction LR
  Tournament ||--o{ TournamentBracketProgressionOverride : "tournamentId"
  TournamentTeam ||--o{ TournamentBracketProgressionOverride : "tournamentTeamId"

TournamentDivisionTier

Tier of one division (= starting bracket) of a tournament, based on the skill of the teams that checked in to it. Tournaments where every team plays the same bracket have one row (bracket idx 0) matching Tournament.tier, tournaments with many starting brackets one row per division.

Rows typed by TournamentDivisionTier

ColumnTypeDescription
tournamentIdnumber → Tournament
bracketIdxnumber

Idx of the starting bracket in Tournament.settings.bracketProgression.

tierTournamentTierNumber

Same scale as Tournament.tier. 1=X, 2=S+, 3=S, 4=A+, 5=A, 6=B+, 7=B, 8=C+, 9=C

Used by 9 repository functions · 45 routes

PlayerStatRepository findSeasonTournamentRunsByUserId

TeamRepository findResultsById

TournamentRepository findDivisionTiersByTournamentIdupsertDivisionTier

TrophyRepository insertTournamentOwnersbackfill

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserId

/calendar/:id/calendar/new/refresh-caches/seed/t/:customUrl/results/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/new/u/:identifier/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/summary-graphic

Relations (1)
erDiagram
  direction LR
  Tournament ||--o{ TournamentDivisionTier : "tournamentId"

TournamentGroup

A set of participants of a stage that play among themselves: a pool of a round robin or swiss stage, or an elimination bracket whose rounds {@link TournamentRound.section} splits into winners, losers and finals. Every elimination stage has one group for now.

Rows typed by TournamentGroup

ColumnTypeDescription
idGeneratedAlways<number>
numbernumber
stageIdnumber → TournamentStage
Used by 6 repository functions · 39 routes

BracketRepository findByTournamentIdinsertBracketresetBracket

TournamentMatchVodRepository findAllForDownloadByTournamentIdfindMatchesWithStartedAt

TournamentMatchRepository findByTournamentTeamId

/calendar/:id/calendar/new/refresh-caches/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (3)
erDiagram
  direction LR
  TournamentStage ||--o{ TournamentGroup : "stageId"
  TournamentGroup ||--o{ TournamentMatch : "groupId"
  TournamentGroup ||--o{ TournamentRound : "groupId"

Referenced by TournamentMatch.groupId, TournamentRound.groupId

TournamentLFGLike

Rows typed by TournamentLFGLike

ColumnTypeDescription
likerTeamIdnumber → TournamentTeam
targetTeamIdnumber → TournamentTeam
createdAtGenerated<number>
Used by 5 repository functions · 6 routes

TournamentLFGRepository mergeTeamsinsertLikedeleteLikefindAllLikesByTeamIdleaveLfg

/to/:id/admin/registration/:tid?/to/:id/join/to/:id/looking/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert

Relations (2)
erDiagram
  direction LR
  TournamentTeam ||--o{ TournamentLFGLike : "likerTeamId"
  TournamentTeam ||--o{ TournamentLFGLike : "targetTeamId"

TournamentMatch

Rows typed by TournamentMatch

ColumnTypeDescription
chatRoomIdnumber | null → ChatRoom
groupIdnumber → TournamentGroup
idGeneratedAlways<number>
numbernumber
opponentOneJSONColumnTypeNullable<ParticipantResult>
opponentTwoJSONColumnTypeNullable<ParticipantResult>
roundIdnumber → TournamentRound
stageIdnumber → TournamentStage
startedAtnumber | null

Set when the match becomes playable i.e. its status is "STARTED"

winnerSideSide | null

The side that won the set. null while the match has no winner.

scheduledAtnumber | null

Leagues: the time the teams (or the organizer) agreed the set is played at.

scheduleSetByOrganizerGenerated<DBBoolean>

Leagues: the organizer set {@link TournamentMatch.scheduledAt}, closing the candidate board for the teams.

Used by 36 repository functions · 71 routes

ChatRepository findAllOpenRoomIdsByUserId

LeaderboardRepository findSeasonPopularUsersWeapon

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchestournamentActivityAtstaffTournamentIdsAtfindScoreboardsByTournamentMatchId

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserId

ReportedWeaponRepository findSeasonReportedWeaponsByUserId

TournamentRepository findAllForShowcaseunlockMatch

BracketRepository findByTournamentIdinsertBracketapplyMatchChangesinsertRoundMatchesdeleteRoundMatchesresetBracket

TournamentMatchVodRepository findVodsByTournamentIdfindAllForDownloadByTournamentIddeleteObsoletefindMatchesWithStartedAt

TournamentMatchRepository findAllByChatRoomIdsfindMatchByIdfindAllResultsByTournamentIdfindUserParticipationByTournamentIdfindByTournamentTeamIdfindLastResultAtsByTournamentIdfindScheduledByUserIdsfindScheduledByUserIdfindScheduledBetweenscheduleMatch

TrophyRepository findWinsByOwner

//admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/calendar/:id/calendar/new/events/friends/ingest/leaderboards/lfg/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/refresh-caches/scrims/scrims/:id/scrims/new/seed/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/players/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/wins/:userId/u/:identifier/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user-card/edit

Relations (9)
erDiagram
  direction LR
  ChatRoom |o--o| TournamentMatch : "chatRoomId"
  TournamentGroup ||--o{ TournamentMatch : "groupId"
  TournamentRound ||--o{ TournamentMatch : "roundId"
  TournamentStage ||--o{ TournamentMatch : "stageId"
  TournamentMatch |o--o{ ReportedWeapon : "tournamentMatchId"
  TournamentMatch ||--o{ TournamentMatchGameResult : "matchId"
  TournamentMatch ||--o{ TournamentMatchPickBanEvent : "matchId"
  TournamentMatch ||--o{ TournamentMatchScheduleProposal : "matchId"
  TournamentMatch ||--o{ TournamentMatchVod : "matchId"

Referenced by ReportedWeapon.tournamentMatchId, TournamentMatchGameResult.matchId, TournamentMatchPickBanEvent.matchId, TournamentMatchScheduleProposal.matchId, TournamentMatchVod.matchId

TournamentMatchGameResult

Rows typed by TournamentMatchGameResult

ColumnTypeDescription
createdAtGenerated<number>
idGeneratedAlways<number>
koDBBoolean | null

Whether the game ended in a knockout. null if not collected for this bracket.

matchIdnumber → TournamentMatch
modeModeShort
numbernumber
reporterIdnumber → User
sourceDBTournamentMaplistSource
stageIdStageId
winnerTeamIdnumber → TournamentTeam
Used by 20 repository functions · 11 routes

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchesfindScoreboardsByTournamentMatchId

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserId

TournamentTeamRepository findRecentlyPlayedMapsByIds

TournamentMatchVodRepository findAllForDownloadByTournamentIdfindMatchesWithStartedAt

TournamentMatchRepository findResultByIdfindResultsByMatchIdinsertResultupdateResultKodeleteResultByIdfindAllResultsByTournamentIdfindUserParticipationByTournamentIdfindByTournamentTeamIdfindLastResultAtsByTournamentId

/ingest/q/match/:id/to/:id/brackets/finalize/to/:id/matches/to/:id/matches/:mid/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/players/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic

Relations (5)
erDiagram
  direction LR
  TournamentMatch ||--o{ TournamentMatchGameResult : "matchId"
  User ||--o{ TournamentMatchGameResult : "reporterId"
  TournamentTeam ||--o{ TournamentMatchGameResult : "winnerTeamId"
  TournamentMatchGameResult |o--o{ IngestedMatchLink : "tournamentMatchGameResultId"
  TournamentMatchGameResult ||--o{ TournamentMatchGameResultParticipant : "matchGameResultId"

Referenced by IngestedMatchLink.tournamentMatchGameResultId, TournamentMatchGameResultParticipant.matchGameResultId

TournamentMatchGameResultParticipant

Rows typed by TournamentMatchGameResultParticipant

ColumnTypeDescription
matchGameResultIdnumber → TournamentMatchGameResult
userIdnumber → User
tournamentTeamIdnumber → TournamentTeam
Used by 15 repository functions · 11 routes

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatches

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserId

TournamentTeamRepository findRecentlyPlayedMapsByIds

TournamentMatchVodRepository findMatchesWithStartedAt

TournamentMatchRepository findResultsByMatchIdsetParticipantsfindAllResultsByTournamentIdfindUserParticipationByTournamentIdfindByTournamentTeamId

TournamentOrganizationRepository countActiveParticipants

/ingest/org/:slug/stats/q/match/:id/to/:id/brackets/finalize/to/:id/matches/:mid/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/players/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic

Relations (3)
erDiagram
  direction LR
  TournamentMatchGameResult ||--o{ TournamentMatchGameResultParticipant : "matchGameResultId"
  TournamentTeam |o--o{ TournamentMatchGameResultParticipant : "tournamentTeamId"
  User ||--o{ TournamentMatchGameResultParticipant : "userId"

TournamentMatchPickBanEvent

Represents one decision, pick or ban, during tournaments pick/ban (counterpick, ban 2) phase.

Rows typed by TournamentMatchPickBanEvent

ColumnTypeDescription
type"PICK" | "BAN" | "ROLL" | "MODE_PICK" | "MODE_BAN"
stageIdStageId | null
modeModeShort | null
matchIdnumber → TournamentMatch
authorIdnumber | null → User
numbernumber
createdAtGenerated<number>
Used by 4 repository functions · 2 routes

TournamentRepository findPickBanEventsByMatchIdinsertPickBanEvent

TournamentMatchRepository deletePickBanEventsByMatchIddeletePickBanEvent

/to/:id/matches/:mid/tournament-match/:id

Relations (2)
erDiagram
  direction LR
  User |o--o{ TournamentMatchPickBanEvent : "authorId"
  TournamentMatch ||--o{ TournamentMatchPickBanEvent : "matchId"

TournamentMatchScheduleProposal

Leagues: a candidate time one team put on the set's scheduling board. Only exists while open, accepting or rejecting deletes the match's proposals.

Rows typed by TournamentMatchScheduleProposal

ColumnTypeDescription
idGeneratedAlways<number>
matchIdnumber → TournamentMatch
tournamentTeamIdnumber → TournamentTeam
authorIdnumber → User
proposedAtnumber

The candidate time.

createdAtGenerated<number>
Used by 6 repository functions · 1 route

TournamentMatchRepository findScheduleProposalsByMatchIdinsertScheduleProposalsreplaceScheduleProposalsfindScheduleProposalByIddeleteScheduleProposalsByTeamscheduleMatch

/to/:id/matches/:mid

Relations (3)
erDiagram
  direction LR
  User ||--o{ TournamentMatchScheduleProposal : "authorId"
  TournamentMatch ||--o{ TournamentMatchScheduleProposal : "matchId"
  TournamentTeam ||--o{ TournamentMatchScheduleProposal : "tournamentTeamId"

TournamentMatchVod

Past broadcast VoD of a tournament match with the offset to jump to the match.

Rows typed by TournamentMatchVod

ColumnTypeDescription
idGeneratedAlways<number>
matchIdnumber → TournamentMatch
userIdnumber | null → User
platformStreamPlatform
accountstring
platformVideoIdstring
timestampSecondsnumber
viewCountnumber
Used by 5 repository functions · 14 routes

TournamentRepository findAllForShowcase

TournamentMatchVodRepository findVodsByTournamentIdfindAllForDownloadByTournamentIdinsertManydeleteObsolete

//api/layout/events/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/join/to/:id/looking/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/upsert

Relations (2)
erDiagram
  direction LR
  TournamentMatch ||--o{ TournamentMatchVod : "matchId"
  User |o--o{ TournamentMatchVod : "userId"

TournamentOrganization

Rows typed by TournamentOrganization

ColumnTypeDescription
idGeneratedAlways<number>
namestring
slugstring
descriptionstring | null
socialsJSONColumnTypeNullable<string[]>
avatarImgIdnumber | null → UnvalidatedUserSubmittedImage
isEstablishedGenerated<DBBoolean>
Used by 17 repository functions · 58 routes

ApiRepository findAllApiTokens

CalendarRepository findAllBetweenTwoTimestampsfindById

TournamentRepository findByIdfindAllForShowcase

TournamentOrganizationRepository insertfindBySlugfindByUserIdsearchByNamefindOneByIdupdateupdateIsEstablisheddeleteById

TrophyRepository findByIdfindPendingByIdallPendingpendingBySubmitter

//admin/api/api/layout/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/new/events/org/:id/org/:slug/org/:slug/edit/org/:slug/stats/org/new/q/refresh-caches/search/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/trophies/:id/backfill/:seriesId/trophies/new/u/:identifier

Relations (8)
erDiagram
  direction LR
  UnvalidatedUserSubmittedImage |o--o{ TournamentOrganization : "avatarImgId"
  TournamentOrganization |o--o{ CalendarEvent : "organizationId"
  TournamentOrganization |o--o{ PendingTrophy : "organizationId"
  TournamentOrganization ||--o{ TournamentOrganizationBadge : "organizationId"
  TournamentOrganization ||--o{ TournamentOrganizationBannedUser : "organizationId"
  TournamentOrganization ||--o{ TournamentOrganizationMember : "organizationId"
  TournamentOrganization ||--o{ TournamentOrganizationSeries : "organizationId"
  TournamentOrganization |o--o{ Trophy : "organizationId"

Referenced by CalendarEvent.organizationId, PendingTrophy.organizationId, TournamentOrganizationBadge.organizationId, TournamentOrganizationBannedUser.organizationId, TournamentOrganizationMember.organizationId, TournamentOrganizationSeries.organizationId, Trophy.organizationId

TournamentOrganizationBadge

Rows typed by TournamentOrganizationBadge

ColumnTypeDescription
organizationIdnumber → TournamentOrganization
badgeIdnumber → Badge
Used by 2 repository functions · 4 routes

TournamentOrganizationRepository findBySlugupdate

/org/:slug/org/:slug/edit/org/:slug/stats/org/new

Relations (2)
erDiagram
  direction LR
  Badge ||--o{ TournamentOrganizationBadge : "badgeId"
  TournamentOrganization ||--o{ TournamentOrganizationBadge : "organizationId"

TournamentOrganizationBannedUser

Rows typed by TournamentOrganizationBannedUser

ColumnTypeDescription
organizationIdnumber → TournamentOrganization
userIdnumber → User
privateNotestring | null
updatedAtGenerated<number>
expiresAtnumber | null
Used by 4 repository functions · 4 routes

TournamentOrganizationRepository upsertBannedUserunbanUserfindAllBannedUsersByOrganizationIdisUserBannedByOrganization

/org/:slug/to/:id/join/to/:id/looking/to/:id/register

Relations (2)
erDiagram
  direction LR
  TournamentOrganization ||--o{ TournamentOrganizationBannedUser : "organizationId"
  User ||--o{ TournamentOrganizationBannedUser : "userId"

TournamentOrganizationMember

Rows typed by TournamentOrganizationMember

ColumnTypeDescription
organizationIdnumber → TournamentOrganization
userIdnumber → User
roleTournamentOrganizationRole
roleDisplayNamestring | null
Used by 11 repository functions · 61 routes

ApiRepository findAllApiTokens

CalendarRepository findRecentTournamentsByOrganizerUserId

ScannerIngestRepository staffTournamentIdsAt

TournamentRepository findByIdfindOrganizerPermissionsByTournamentIds

TournamentOrganizationRepository insertfindBySlugfindByUserIdupdatedeleteOwnMembershipcountOrganizationsByUserId

/admin/admin/voice/api/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/voice/rooms/:id/api/voice/webhook/calendar/:id/calendar/new/events/ingest/org/:id/org/:slug/org/:slug/edit/org/:slug/stats/org/new/q/q/looking/q/match/:id/refresh-caches/scrims/:id/seed/sse/:connectionId/topics/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/u/:identifier

Relations (2)
erDiagram
  direction LR
  TournamentOrganization ||--o{ TournamentOrganizationMember : "organizationId"
  User ||--o{ TournamentOrganizationMember : "userId"

TournamentOrganizationSeries

Rows typed by TournamentOrganizationSeries

ColumnTypeDescription
idGeneratedAlways<number>
organizationIdnumber → TournamentOrganization
namestring
descriptionstring | null
substringMatchesJSONColumnType<string[]>
showLeaderboardGenerated<DBBoolean>
tierHistoryJSONColumnTypeNullable<TournamentTierNumber[]>
Used by 6 repository functions · 57 routes

TournamentRepository findById

TournamentOrganizationRepository findBySlugfindAllSeriesfindAllSeriesByOrganizationIdsupdateupdateSeriesTierHistory

//api/layout/calendar/calendar.ics/calendar/:id/calendar/new/events/friends/org/:slug/org/:slug/edit/org/:slug/stats/org/new/refresh-caches/scrims/scrims/new/seed/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/tournaments/trophies/new

Relations (1)
erDiagram
  direction LR
  TournamentOrganization ||--o{ TournamentOrganizationSeries : "organizationId"

TournamentResult

Rows typed by TournamentResult

ColumnTypeDescription
isHighlightGenerated<DBBoolean>
participantCountnumber
placementnumber
tournamentIdnumber → Tournament
tournamentTeamIdnumber → TournamentTeam
setResultsJSONColumnType<WinLossParticipationArray>

E.g. ["W", "L", null] = won the first set, lost the second, did not play the third.

userIdnumber → User
divstring | null

Division label for tournaments with multiple starting brackets (e.g., "D1", "D2")

Used by 28 repository functions · 34 routes

CalendarRepository findAllBetweenTwoTimestamps

LeaderboardRepository findSeasonsParticipatedInByUserId

PlayerStatRepository findSeasonTournamentPlacementsByUserIdfindSeasonTournamentRunsByUserId

SQMatchRepository countSeasonResultPagesByUserIdfindSeasonResultsByUserIdfindSeasonDaySummariesByUserId

TeamRepository findResultPlacementsByIdfindResultsById

TournamentRepository findResultsByTournamentIdfindLatestFinalizedLeagueParticipantsfindAllForShowcasefindShowcaseCountsByIdfindTopThreeResultsByTournamentIdsreopenTournamentfinalize

TournamentOrganizationRepository findEventsByMonthfindPaginatedEventsBySeriesfindAllSeriesWinsByUserId

TrophyRepository findWinsByOwnerfindAllBackfillableTournaments

UserRepository findLayoutDataByIdfindWidgetsByUserIdfindResultsByUserIdcountResultsByUserIdhasHighlightedResultsByUserIdfindResultPlacementsByUserIdupdateOwnResultHighlights

//api/layout/calendar/calendar.ics/events/org/:slug/t/:customUrl/t/:customUrl/results/to/:id/admin/to/:id/admin/to/:id/admin/brackets/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/join/to/:id/looking/to/:id/register/to/:id/results/to/:id/teams/:tid/comps/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/upsert/trophies/:id/backfill/:seriesId/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic

Relations (3)
erDiagram
  direction LR
  Tournament ||--o{ TournamentResult : "tournamentId"
  TournamentTeam ||--o{ TournamentResult : "tournamentTeamId"
  User ||--o{ TournamentResult : "userId"

TournamentRound

Groups matches played at the same time (round-robin, swiss) or one round of a bracket (elimination).

Rows typed by TournamentRound

ColumnTypeDescription
groupIdnumber → TournamentGroup
idGeneratedAlways<number>
numbernumber

Restarts from 1 per group, and in an elimination group per {@link TournamentRound.section}.

stageIdnumber → TournamentStage
sectionTournamentRoundSection | null

Part of the elimination group the round belongs to. null in round robin and swiss.

mapsJSONColumnType<TournamentRoundMaps>
isPlayableAtnumber | null

Leagues: the round's sets are playable from this time on. Null = playable whenever.

Used by 8 repository functions · 39 routes

BracketRepository findByTournamentIdinsertBracketresetBracket

TournamentMatchVodRepository findAllForDownloadByTournamentIdfindMatchesWithStartedAt

TournamentMatchRepository findMatchByIdfindAllResultsByTournamentIdfindByTournamentTeamId

/calendar/:id/calendar/new/refresh-caches/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (3)
erDiagram
  direction LR
  TournamentGroup ||--o{ TournamentRound : "groupId"
  TournamentStage ||--o{ TournamentRound : "stageId"
  TournamentRound ||--o{ TournamentMatch : "roundId"

Referenced by TournamentMatch.roundId

TournamentStaff

Rows typed by TournamentStaff

ColumnTypeDescription
tournamentIdnumber → Tournament
userIdnumber → User
roleTournamentStaffRole
Used by 7 repository functions · 54 routes

CalendarRepository findRecentTournamentsByOrganizerUserIdinsert

ScannerIngestRepository staffTournamentIdsAt

TournamentRepository findByIdfindRelatedUsersByTournamentIdsfindOrganizerPermissionsByTournamentIdssetStaff

//admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/calendar/:id/calendar/new/events/ingest/q/looking/q/match/:id/refresh-caches/scrims/:id/seed/sse/:connectionId/topics/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (2)
erDiagram
  direction LR
  Tournament ||--o{ TournamentStaff : "tournamentId"
  User ||--o{ TournamentStaff : "userId"

TournamentStage

A stage is an intermediate phase in a tournament. In essence a bracket.

Rows typed by TournamentStage

ColumnTypeDescription
idGeneratedAlways<number>
namestring
numbernumber
settingsJSONColumnType<StageSettings>
tournamentIdnumber → Tournament
type(typeof TOURNAMENT_STAGE_TYPES)[number]
createdAtGenerated<number>
Used by 30 repository functions · 73 routes

CalendarRepository findAllBetweenTwoTimestamps

LeaderboardRepository findSeasonPopularUsersWeapon

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchesstaffTournamentIdsAt

PlayerStatRepository findSeasonSetScoresByUserIdfindSeasonSetParticipantsByUserIdfindSeasonBestSetsByUserId

ReportedWeaponRepository findSeasonReportedWeaponsByUserId

TournamentRepository findAllForShowcasefindShowcaseCountsByIdfindRunningTournamentIds

BracketRepository findByTournamentIdinsertBracketresetBracket

TournamentMatchVodRepository findVodsByTournamentIdfindAllForDownloadByTournamentIddeleteObsoletefindMatchesWithStartedAt

TournamentMatchRepository findAllByChatRoomIdsfindMatchByIdfindAllResultsByTournamentIdfindUserParticipationByTournamentIdfindLastResultAtsByTournamentIdfindScheduledByUserIdsfindScheduledByUserIdfindScheduledBetween

TrophyRepository findWinsByOwner

//admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/voice/rooms/:id/api/voice/webhook/calendar/calendar.ics/calendar/:id/calendar/new/events/friends/ingest/leaderboards/lfg/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/refresh-caches/scrims/scrims/:id/scrims/new/seed/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/players/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/wins/:userId/u/:identifier/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/user-card/edit

Relations (4)
erDiagram
  direction LR
  Tournament ||--o{ TournamentStage : "tournamentId"
  TournamentStage ||--o{ TournamentGroup : "stageId"
  TournamentStage ||--o{ TournamentMatch : "stageId"
  TournamentStage ||--o{ TournamentRound : "stageId"

Referenced by TournamentGroup.stageId, TournamentMatch.stageId, TournamentRound.stageId

TournamentStreamer

Account seen streaming the tournament while it was running, used to find match VoDs afterwards.

Rows typed by TournamentStreamer

ColumnTypeDescription
idGeneratedAlways<number>
userIdnumber | null → User

Null for cast accounts not linked to a sendou.ink user.

tournamentIdnumber → Tournament
platformStreamPlatform
accountstring
Used by 3 repository functions · 1 route

AdminRepository migrate

LiveStreamRepository insertTournamentStreamers

TournamentMatchVodRepository findStreamersByTournamentId

/admin

Relations (2)
erDiagram
  direction LR
  Tournament ||--o{ TournamentStreamer : "tournamentId"
  User |o--o{ TournamentStreamer : "userId"

TournamentTeam

Rows typed by TournamentTeam

ColumnTypeDescription
createdAtGenerated<number>
idGeneratedAlways<number>
inviteCodestring
namestring
prefersNotToHostGenerated<DBBoolean>
droppedOutGenerated<DBBoolean>
seednumber | null
startingBracketIdxnumber | null

For formats that have many starting brackets, where should the team start?

activeRosterUserIdsJSONColumnTypeNullable<number[]>
tournamentIdnumber → Tournament
teamIdnumber | null → AllTeam

Optional link to a sendou.ink team, for its avatar & name.

avatarImgIdnumber | null → UnvalidatedUserSubmittedImage
isLookingGenerated<DBBoolean>

The team is shown on the tournament's LFG page.

isPlaceholderGenerated<DBBoolean>

Temporary team created automatically when an unregistered user joins the tournament's LFG. - A registered team joining the LFG reuses itself, only toggling isLooking - When a placeholder team's user registers for the tournament, the placeholder team is deleted and a regular team created - When two placeholder teams merge the surviving team stops being a placeholder - When a placeholder team and a registered team merge the registered team survives - On merge, each member's isStayAsSub preference is kept

lfgNotestring | null
chatRoomIdnumber | null → ChatRoom
abDivisionnumber | null

A/B division assignment for bipartite round robin brackets. 0 = A, 1 = B, null = unassigned.

tournamentTeamHistoryIdnumber | null → TournamentTeamHistory

The team's {@link TournamentTeamHistory} row, created lazily on its first audited event.

Used by 67 repository functions · 77 routes

CalendarRepository findAllBetweenTwoTimestampsupdate

ChatRepository findAllOpenRoomIdsByUserId

FriendRepository findByUserIdWithActivity

ScannerIngestRepository tournamentActivityAt

PlayerStatRepository findSeasonTournamentRunsByUserId

TeamRepository findResultPlacementsByIdfindResultsById

TournamentAuditLogRepository insertupdateTeamHistoryName

TournamentRepository findByIdfindStreamsByTournamentIdfindParticipatedUserIdsByIdfindTeamsFullByTournamentIdfindParticipantStreamAccountsfindLatestFinalizedLeagueParticipantsfindRelatedUsersByTournamentIdsfindAllForShowcasefindShowcaseCountsByIdfindPendingCheckInsStartingBetweenfindFriendCodesByTournamentIdupdateProgressionupdateTeamSeeds

TournamentTeamRepository findAllByChatRoomIdssetActiveRosterupdateOwnMemberInGameNameForNonStartedinsertupsertRegistrationupdateupdateStartingBracketsupdateAbDivisionsdropOutundoDropOutjoindeleteByIdfindAllRegistrationsByUserIdsfindInviteCodeByIdfindAllChatRoomIdsByIdsisPickupAvatarImgIdfindByInviteCode

BracketRepository insertBracket

TournamentMatchVodRepository findVodsByTournamentId

TournamentLFGRepository startLookinginsertPlaceholderTeamfindLookingTeamsByTournamentIdfindSubGroupsmergeTeamsupdateTeamNoteleaveLfgfindAllSubsByTournamentId

TournamentMatchRepository findAllResultsByTournamentIdfindByTournamentTeamIdfindScheduledByUserIdsfindScheduledByUserIdfindScheduledBetween

TournamentOrganizationRepository findEventsByMonthfindAllOrganizedTournamentTeamCountsfindPaginatedEventsBySeriescountActiveParticipants

TrophyRepository findTournamentsByTrophyIdfindWinsByOwnerfindAllBackfillableTournamentsinsertTournamentOwnersbackfill

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserId

//admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/webhook/calendar/calendar.ics/calendar/:id/calendar/new/events/friends/ingest/org/:slug/org/:slug/stats/q/looking/q/match/:id/refresh-caches/scrims/scrims/:id/scrims/new/seed/sse/:connectionId/topics/t/:customUrl/t/:customUrl/results/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/streams/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/tournaments/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/edit/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/summary-graphic

Relations (15)
erDiagram
  direction LR
  UnvalidatedUserSubmittedImage |o--o{ TournamentTeam : "avatarImgId"
  ChatRoom |o--o| TournamentTeam : "chatRoomId"
  AllTeam |o--o{ TournamentTeam : "teamId"
  Tournament ||--o{ TournamentTeam : "tournamentId"
  TournamentTeamHistory |o--o{ TournamentTeam : "tournamentTeamHistoryId"
  TournamentTeam |o--o{ MapPoolMap : "tournamentTeamId"
  TournamentTeam ||--o{ TournamentBracketProgressionOverride : "tournamentTeamId"
  TournamentTeam ||--o{ TournamentLFGLike : "likerTeamId"
  TournamentTeam ||--o{ TournamentLFGLike : "targetTeamId"
  TournamentTeam ||--o{ TournamentMatchGameResult : "winnerTeamId"
  TournamentTeam |o--o{ TournamentMatchGameResultParticipant : "tournamentTeamId"
  TournamentTeam ||--o{ TournamentMatchScheduleProposal : "tournamentTeamId"
  TournamentTeam ||--o{ TournamentResult : "tournamentTeamId"
  TournamentTeam ||--o{ TournamentTeamCheckIn : "tournamentTeamId"
  TournamentTeam ||--o{ TournamentTeamMember : "tournamentTeamId"

Referenced by MapPoolMap.tournamentTeamId, TournamentBracketProgressionOverride.tournamentTeamId, TournamentLFGLike.likerTeamId, TournamentLFGLike.targetTeamId, TournamentMatchGameResult.winnerTeamId, TournamentMatchGameResultParticipant.tournamentTeamId, TournamentMatchScheduleProposal.tournamentTeamId, TournamentResult.tournamentTeamId, TournamentTeamCheckIn.tournamentTeamId, TournamentTeamMember.tournamentTeamId

TournamentTeamCheckIn

Rows typed by TournamentTeamCheckIn

ColumnTypeDescription
checkedInAtnumber
bracketIdxnumber | null

Which bracket checked in for. If missing is check in for the whole event.

tournamentTeamIdnumber → TournamentTeam
isCheckOutGenerated<DBBoolean>

Indicates that this bracket defaults to checked in and this team has been explicitly checked out from it

Used by 12 repository functions · 47 routes

CalendarRepository findAllBetweenTwoTimestampsupdate

TournamentRepository findByIdfindTeamsFullByTournamentIdfindAllForShowcasefindShowcaseCountsByIdfindPendingCheckInsStartingBetweenupdateProgression

TournamentTeamRepository checkIncheckOutdropOut

TournamentOrganizationRepository countActiveParticipants

//api/layout/api/status/calendar/calendar.ics/calendar/:id/calendar/new/events/org/:slug/stats/refresh-caches/seed/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (1)
erDiagram
  direction LR
  TournamentTeam ||--o{ TournamentTeamCheckIn : "tournamentTeamId"

TournamentTeamHistory

Stable shadow of a tournament team's identity that survives the team's hard-deletion, so the audit log can still resolve its name.

Rows typed by TournamentTeamHistory

ColumnTypeDescription
idGeneratedAlways<number>

Surrogate key. Audit log rows reference this so a reused TournamentTeam.id can never collide with an older team's history.

tournamentTeamIdnumber

Mirrors the original TournamentTeam.id at creation time. Informational only; not a live or unique foreign key, so it is not cascade-deleted with the team and may repeat across teams that reused an id.

tournamentIdnumber → Tournament
namestring
Used by 4 repository functions · 11 routes

TournamentAuditLogRepository insertupdateTeamHistoryNamefindByTournamentIdfindTeamsByTournamentId

/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/join/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert

Relations (3)
erDiagram
  direction LR
  Tournament ||--o{ TournamentTeamHistory : "tournamentId"
  TournamentTeamHistory |o--o{ TournamentAuditLog : "tournamentTeamHistoryId"
  TournamentTeamHistory |o--o{ TournamentTeam : "tournamentTeamHistoryId"

Referenced by TournamentAuditLog.tournamentTeamHistoryId, TournamentTeam.tournamentTeamHistoryId

TournamentTeamMember

Rows typed by TournamentTeamMember

ColumnTypeDescription
createdAtGenerated<number>
inGameNamestring | null
tournamentTeamIdnumber → TournamentTeam
userIdnumber → User
roleGenerated<"OWNER" | "MANAGER" | "REGULAR">
isStayAsSubGenerated<DBBoolean>
isSubGenerated<DBBoolean>

Set when the member was added to the roster after registration closed.

isOrganizerAddedGenerated<DBBoolean>

Set when the member was added to the roster by the tournament organizer instead of joining on their own.

isLookingGenerated<DBBoolean>

Denormalized from TournamentTeam.isLooking

Used by 48 repository functions · 64 routes

AdminRepository migrate

CalendarRepository findAllBetweenTwoTimestamps

ChatRepository findAllOpenRoomIdsByUserId

FriendRepository findByUserIdWithActivity

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchestournamentActivityAt

TournamentRepository findByIdfindStreamsByTournamentIdfindParticipatedUserIdsByIdfindTeamsFullByTournamentIdfindParticipantStreamAccountsfindRelatedUsersByTournamentIdsfindAllForShowcasefindShowcaseCountsByIdfindPendingCheckInsStartingBetweenfindFriendCodesByTournamentIdupdateTeamSeeds

TournamentTeamRepository findAllByChatRoomIdsfindAllMembersByTeamIdsupdateMemberInGameNameupdateOwnMemberInGameNameForNonStartedinsertupsertRegistrationjoindeleteByIdisOrganizerAddedMemberleavefindAllRegistrationsByUserIds

TournamentMatchVodRepository findVodsByTournamentIdfindAllForDownloadByTournamentId

TournamentLFGRepository startLookinginsertPlaceholderTeamfindLookingTeamsByTournamentIdfindSubGroupsmergeTeamsupdateMemberRoleupdateOwnStayAsSubleaveLfgfindAllSubsByTournamentId

TournamentMatchRepository findMatchByIdfindAllResultsByTournamentIdfindByTournamentTeamIdfindScheduledByUserIdsfindScheduledByUserIdfindScheduledBetween

//admin/admin/voice/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/webhook/calendar/calendar.ics/calendar/:id/calendar/new/events/friends/ingest/q/looking/q/match/:id/refresh-caches/scrims/scrims/:id/scrims/new/seed/sse/:connectionId/topics/t/:customUrl/schedule/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/streams/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/u/:identifier/edit

Relations (2)
erDiagram
  direction LR
  TournamentTeam ||--o{ TournamentTeamMember : "tournamentTeamId"
  User ||--o{ TournamentTeamMember : "userId"

Trophy

Rows typed by Trophy

ColumnTypeDescription
idGeneratedAlways<number>
namestring
modelstring
codeGenerated<string | null>

Identifies special trophies, null for regular trophies.

organizationIdnumber | null → TournamentOrganization
creatorIdnumber | null → User
managerIdnumber | null → User
Used by 22 repository functions · 29 routes

AdminRepository migrate

CalendarRepository findAllBetweenTwoTimestampsfindById

TournamentRepository findAllForShowcase

TrophyRepository allfindByOrganizationIdfindByOrganizationIdsfindByOwnerUserIdfindByOwnerUserIdIncludingHiddenfindByIdisAwardableByOrganizationexistsByNamefindAllXpfindCodeByIdfindAllForEditinginsertTournamentOwnersbackfillsyncSpecialTrophiesfindPendingByIdallPendingpendingBySubmitteraddApproval

//admin/api/layout/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/new/events/org/:slug/player/:id/to/:id/admin/to/:id/admin/to/:id/admin/registration/:tid?/to/:id/brackets/to/:id/brackets/finalize/to/:id/join/to/:id/looking/to/:id/register/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/upsert/trophies/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/placements/:userId/trophies/new/u/:identifier/u/:identifier/edit

Relations (7)
erDiagram
  direction LR
  User |o--o{ Trophy : "creatorId"
  User |o--o{ Trophy : "managerId"
  TournamentOrganization |o--o{ Trophy : "organizationId"
  Trophy |o--o{ CalendarEvent : "trophyId"
  Trophy |o--o{ PendingTrophy : "targetTrophyId"
  Trophy ||--o{ SpecialTrophyOwner : "trophyId"
  Trophy ||--o{ TrophyOwner : "trophyId"

Referenced by CalendarEvent.trophyId, PendingTrophy.targetTrophyId, SpecialTrophyOwner.trophyId, TrophyOwner.trophyId

TrophyOwner

Rows typed by TrophyOwner

ColumnTypeDescription
trophyIdnumber → Trophy
userIdnumber → User
tournamentIdnumber → Tournament
tiernumber | null
Used by 7 repository functions · 8 routes

AdminRepository migrate

TrophyRepository findByOwnerUserIdfindByOwnerUserIdIncludingHiddenfindByIdfindWinsByOwnerinsertTournamentOwnersbackfill

/admin/to/:id/brackets/finalize/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/edit

Relations (3)
erDiagram
  direction LR
  Tournament ||--o{ TrophyOwner : "tournamentId"
  Trophy ||--o{ TrophyOwner : "trophyId"
  User ||--o{ TrophyOwner : "userId"

TrustRelationship

Indicates a user trusts another. Allows direct adding to groups/teams without invite links.

Rows typed by TrustRelationship

ColumnTypeDescription
trustGiverUserIdnumber → User
trustReceiverUserIdnumber → User
lastUsedAtnumber

No repository function or route queries it.

Relations (2)
erDiagram
  direction LR
  User ||--o{ TrustRelationship : "trustGiverUserId"
  User ||--o{ TrustRelationship : "trustReceiverUserId"

UnvalidatedUserSubmittedImage

Table backing the UserSubmittedImage view. Includes images awaiting validation.

Rows typed by UnvalidatedUserSubmittedImage

ColumnTypeDescription
idGeneratedAlways<number>
submitterUserIdnumber → User
urlstring
validatedAtnumber | null

When was the image validated? If null should be hidden from other users.

Used by 42 repository functions · 132 routes

AdminRepository migrate

ArtRepository insert

CalendarRepository findAllBetweenTwoTimestampsinsertupdate

ImageRepository findByIddeleteByIdcountUnvalidatedArtcountAllUnvalidatedfindAllUnvalidatedcountUnvalidatedBySubmitterUserIdvalidateByIdinsert

ScrimPostRepository findByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindPendingOverlapsForUsersfindUserScrims

PlayerStatRepository findSeasonTournamentRunsByUserId

SQMatchRepository findSeasonResultsByUserId

TeamRepository findByCustomUrlfindResultsByIdupdate

TournamentRepository findByIdfindAllForShowcasefindPendingCheckInsStartingBetweensearchByName

TournamentTeamRepository findAllByChatRoomIds

TournamentMatchRepository findAllByChatRoomIdsfindScheduledByUserId

TournamentOrganizationRepository findEventsByMonthfindPaginatedEventsBySeriesfindAllEventsBySeriesupdate

TrophyRepository findTournamentsByTrophyIdfindWinsByOwnerfindAllBackfillableTournaments

UserCardRepository updateOwnCard

UserRepository findWidgetsByUserIdfindResultsByUserIdreplaceSyncedAvatarupdateOwnProfile

//admin/admin/streams/admin/voice/api/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/mentions/seen/api/chat/rooms/:id/messages/api/chat/rooms/:id/read/api/layout/api/status/api/voice/rooms/:id/api/voice/telemetry/api/voice/webhook/art/new/associations/associations/new/auth/auth/callback/auth/create-link/auth/impersonate/auth/impersonate/stop/auth/logout/auth/refresh/badges/:id/edit/calendar/calendar.ics/calendar/:id/calendar/:id/report-winners/calendar/new/end-season/events/friends/ingest/leaderboards/lfg/lfg/new/notifications/seen/notifications/subscribe/org/:slug/org/:slug/edit/org/new/patrons/player/:id/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/run-routine/scrims/scrims/:id/scrims/new/search/seed/set-plus-voting-active/settings/sidenav/sse/:connectionId/topics/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/theme/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/to/search/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/tournaments/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/admin/u/:identifier/art/u/:identifier/builds/u/:identifier/builds/new/u/:identifier/edit/u/:identifier/edit-widgets/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/summary-graphic/upload/admin/user-card/:id/note/user-card/edit/user-report/:id/vods/:id/vods/new

Relations (11)
erDiagram
  direction LR
  User ||--o{ UnvalidatedUserSubmittedImage : "submitterUserId"
  UnvalidatedUserSubmittedImage |o--o{ AllTeam : "avatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ AllTeam : "bannerImgId"
  UnvalidatedUserSubmittedImage ||--o{ Art : "imgId"
  UnvalidatedUserSubmittedImage |o--o{ CalendarEvent : "avatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ ExternalStream : "avatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ TournamentOrganization : "avatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ TournamentTeam : "avatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ User : "bannerImgId"
  UnvalidatedUserSubmittedImage |o--o{ User : "customAvatarImgId"
  UnvalidatedUserSubmittedImage |o--o{ User : "syncedAvatarImgId"

Referenced by AllTeam.avatarImgId, AllTeam.bannerImgId, Art.imgId, CalendarEvent.avatarImgId, ExternalStream.avatarImgId, TournamentOrganization.avatarImgId, TournamentTeam.avatarImgId, User.bannerImgId, User.customAvatarImgId, User.syncedAvatarImgId

UnvalidatedVideo

Table backing the Video view. Includes videos awaiting validation.

Rows typed by UnvalidatedVideo

ColumnTypeDescription
eventIdnumber | null → CalendarEvent
idGeneratedAlways<number>
submitterUserIdnumber → User
titlestring
type(typeof videoMatchTypes)[number]
validatedAtnumber | null
youtubePublishedAtnumber

When the video was published on YouTube. Day precision only, stored as noon UTC of that day.

youtubeIdstring
Used by 3 repository functions · 2 routes

VodRepository updateinsertdeleteById

/vods/:id/vods/new

Relations (3)
erDiagram
  direction LR
  CalendarEvent |o--o{ UnvalidatedVideo : "eventId"
  User ||--o{ UnvalidatedVideo : "submitterUserId"
  UnvalidatedVideo ||--o{ VideoMatch : "videoId"

Referenced by VideoMatch.videoId

User

Rows typed by User

ColumnTypeDescription
bannedGenerated<number | null>

1 = permabanned, timestamp = ban active till then

bannedReasonstring | null
shortBiostring | null

Shown on user card

commissionsOpenGenerated<DBBoolean>
commissionsOpenedAtnumber | null
commissionTextstring | null
countrystring | null
customThemeJSONColumnTypeNullable<CustomTheme>
customUrlstring | null
discordAvatarstring | null

Hash of the Discord avatar syncedAvatarImgId was copied from, for noticing when it changes.

customAvatarImgIdnumber | null → UnvalidatedUserSubmittedImage

Avatar uploaded by the user, shown over syncedAvatarImgId.

syncedAvatarImgIdnumber | null → UnvalidatedUserSubmittedImage

Avatar copied from the account the user logs in with.

discordIdstring
discordNamestring
customNamestring | null
usernameColumnType<string, never, never>

coalesce(customName, discordName)

tournamentNamestring | null

Name the user is shown under in tournaments, set by organizers of established organizations. null = their username is used.

discordUniqueNamestring | null
favoriteTrophyIdsJSONColumnTypeNullable<number[]>
hiddenTrophyIdsJSONColumnTypeNullable<number[]>
idGeneratedAlways<number>
inGameNamestring | null
isArtistGenerated<DBBoolean>
isVideoAdderGenerated<DBBoolean>
isTournamentOrganizerGenerated<DBBoolean>
isApiAccesserGenerated<DBBoolean>
languagesJSONColumnTypeNullable<UnifiedLanguageCode[]>
pronounsJSONColumnTypeNullable<Pronouns>
patronStartedAtnumber | null
patronTiernumber | null
patronExpiresAtnumber | null
twitchstring | null
bskystring | null
vcGenerated<UserVoiceChat>
youtubeIdstring | null
youtubeNamestring | null
mapModePreferencesJSONColumnTypeNullable<UserMapModePreferences>
weaponPoolJSONColumnTypeNullable<WeaponPoolEntry[]>
plusSkippedForSeasonNthnumber | null
noScreenGenerated<DBBoolean>
buildSortingJSONColumnTypeNullable<BuildSort[]>
preferencesJSONColumnTypeNullable<UserPreferences>
createdAtnumber | null

Can be null because we did not always save this.

joinOrdernumber | null
bannerPresetImgstring | null

User card banner preset, raw text (not JSON): a hex code ("#8b0000") or a stage id ("16"). bannerImgId takes precedence.

bannerImgIdnumber | null → UnvalidatedUserSubmittedImage

Supporter-uploaded user card banner (UserSubmittedImage id). Takes precedence over bannerPresetImg.

hiddenCardStatsJSONColumnTypeNullable<Array<HideableUserCardStat>>

Card stat types the user has chosen to hide from their card.

divstring | null

Div in the latest finished LUTI (e.g. "2" or "X"). Must have been in a team that did not drop and the user played at least one match (got result as well)

divSeasonnumber | null

LUTI season div was earned in.

unverifiedPeakXPJSONColumnTypeNullable<PeakXP>

Peak XP as indicated by the user. Should have either takoroka or tentatek key defined but not both.

xpDivisionXRankPlacementRegion | null

Division the user card's XP is taken from. null when the user has not picked one, showing their highest XP across both.

Used by 179 repository functions · 139 routes

AdminRepository migratemakeVideoAdderByUserIdmakeArtistByUserIdmakeTournamentOrganizerByUserIdmakeApiAccesserByUserIdforcePatronfindAllBannedUsersbanUserunbanUser

ApiRepository findAllApiTokens

ArtRepository findShowcaseArtsfindShowcaseArtsByTagfindRecentlyUploadedArtsfindArtsByUserId

AssociationRepository findByIdfindByMemberUserIdfindByInviteCodeinsert

AvailabilityRepository findScheduleVisibleUserIds

BadgeRepository findAllfindByIdfindByOwnerUserId

BuildRepository findPageByWeaponId

CalendarRepository findByIdfindResultsByEventIdfindTopThreeResultsByEventIds

ChatRepository findAllMessagesByRoomIdfindMessageByIdfindAllParticipantsByUserIds

FriendRepository findByUserIdWithActivityfindPendingSentRequestsfindPendingReceivedRequestsfindFriendRequestByIdAndReceiverfindMutualFriendsfindFriendsByUserId

ImageRepository findAllUnvalidated

LeaderboardRepository findTeamLeaderboardBySeasonfindAllXPLeaderboardfindModeXPLeaderboardfindWeaponXPLeaderboardfindUserSPLeaderboard

LFGRepository findBoardPagefindVisibleByIdfindAllOwn

LiveStreamRepository findXRankStreams

MatchProfileRepository findSettingsByUserIdfindMapModePreferencesByUserIdfindWeaponPoolByUserIdupdateOwnMatchProfile

NotificationRepository findUnseenSubscriptionsByNotificationId

PlusSuggestionRepository findAllByMonth

PlusVotingRepository findResultsByMonthYearfindAllUsersForVoting

ScannerIngestRepository gamesPlayedByUserInTournamentgamesPlayedByUserSincecastedGamesInTournamentgamesInTournamentMatchesgamesInGroupMatchsendouqGamesPlayedByUserSince

ScrimPickupRosterRepository findAllOwnRecent

ScrimPostRepository findByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindPendingOverlapsForUsersfindUserScrims

SQGroupRepository findMapModePreferencesByGroupIdfindCurrentGroupsfindAllLikesByGroupIdfindAllSuggestionsByGroupIdfindFriendsAndTeammatesfindAllMapModePreferencesBySeasonNth

PlayerStatRepository findSeasonMatesEnemiesByUserIdfindSeasonBestSetsByUserId

SQMatchRepository findByIdfindSeasonResultsByUserIdfindSeasonCanceledMatchesByUserIdinsertcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

QStreamsRepository findAllActiveMatchPlayers

TeamRepository searchByNamefindByCustomUrlfindResultsByIdfindAllByMemberUserIdswitchOwnMainTeamdeleteByIdinsertOwnMembershiphandleMemberLeavingupdateRoster

XRankPlacementRepository findPlacementsOfMonthfindPlacementsByPlayerIdfindPlacementsByUserId

TournamentAuditLogRepository findByTournamentId

TournamentRepository findByIdfindStreamsByTournamentIdfindTeamsFullByTournamentIdfindParticipantStreamAccountsfindAllForShowcasefindTopThreeResultsByTournamentIdsupdateTeamSeeds

TournamentTeamRepository insertupsertRegistrationjoin

TournamentMatchVodRepository findVodsByTournamentId

TournamentLFGRepository findLookingTeamsByTournamentIdfindSubGroupsmergeTeams

TournamentMatchRepository findMatchByIdfindByTournamentTeamIdfindScheduleProposalsByMatchId

TournamentOrganizationRepository findBySlugfindEventsByMonthfindPaginatedEventsBySeriesfindAllBannedUsersByOrganizationId

TrophyRepository findByOwnerUserIdfindByOwnerUserIdIncludingHiddenfindByIdfindWinsByOwnerfindAllBackfillableTournamentsfindPendingByIdallPendingpendingBySubmitter

UserCardRepository findAllByUserIdsfindAllByUserIdsCachedfindCardEditExtrasByUserIdfindVerifiedXpByUserIdupdateOwnCard

UserRepository findIdByIdentifierfindPageUserByIdentifierfindCountriesByUserIdsfindDiscordIdsByUserIdsfindBuildFieldsByUserIdfindLayoutDataByIdfindProfileByUserIdfindStoredWidgetsByUserIdfindWidgetsByUserIdfindByCustomUrlfindByFriendCodefindUsernameByIdfindLeanByIdfindModInfoByIdfindAllPatronsfindAllPatronsForFooterfindAllPlusServerMembersexistingUserIdsfindResultsByUserIdsearchsearchExactfindFriendCodesByUserIdfindInGameNameByUserIdfindPatronStartedAtByUserIdfindDivByUserIdfindJoinOrderByUserIdfindCommissionsByUserIdupsertreplaceSyncedAvatarupdateOwnProfileupdateManyDivsupdateOwnCustomThemeupdateOwnPreferencesupdateOwnBuildSortingupdatePatronDataanyUserPrefersNoScreenfindSocialLinksByUserIdfindIdsByStreamAccounts

UserReportRepository findAllByReportedUserId

VodRepository findByUserIdfindVodsfindVodById

VoiceRepository findPlayerAdoptionSincefindVoiceChatPreferencesfindLatestClientErrorsfindLatestFeedbackComments

//admin/admin/voice/analyzer/api/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/layout/api/status/api/voice/rooms/:id/art/art/new/associations/associations/new/auth/callback/auth/create-link/badges/badges/:id/badges/:id/edit/builds/builds/:slug/calendar/calendar/:id/calendar/:id/report-winners/calendar/new/events/friends/friends-for-adding/ingest/leaderboards/lfg/lfg/new/object-damage-calculator/org/:id/org/:slug/org/:slug/edit/org/:slug/stats/org/new/patrons/patrons-list/player/:id/plus/list/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/plus/voting/results/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/refresh-caches/scrims/scrims/:id/scrims/new/search/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/short/:customUrl/suspended/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/streams/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/placements/:userId/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/art/u/:identifier/builds/u/:identifier/edit/u/:identifier/edit-widgets/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/u/:identifier/vods/upload/admin/user-card/:id/friendship/user-card/edit/user-report/:id/user/:identifier/user/:identifier/ids/user/:userId/active-match/vods/vods/:id/vods/new/xsearch

Relations (110)

Referenced by AllTeamMember.userId, ApiToken.userId, Art.authorId, ArtTag.authorId, ArtUserMetadata.userId, AssociationMember.userId, AvailabilityWeek.userId, Badge.authorId, BadgeManager.userId, BanLog.bannedByUserId, BanLog.userId, Build.ownerId, CalendarEvent.authorId, CalendarEventResultPlayer.userId, ChatMessage.authorUserId, ChatMessageReadIndicator.userId, FriendRequest.receiverId, FriendRequest.senderId, Friendship.userOneId, Friendship.userTwoId, GroupLike.createdByUserId, GroupMatch.cancelAcceptedByUserId, GroupMatch.cancelRequestedByUserId, GroupMatch.confirmedByUserId, GroupMatchCancelReport.authorUserId, GroupMatchCancelReportPlayer.userId, GroupMatchContinueVote.userId, GroupMatchMap.reportedByUserId, GroupMember.addedByUserId, GroupMember.userId, GroupReadyCheckConfirmation.userId, GroupSuggestion.createdByUserId, IngestedMatch.povUserId, IngestedMatch.submitterUserId, LeaderboardTeamSkip.skippedByUserId, LFGPost.authorId, LiveStream.userId, LogInLink.userId, MapResult.userId, ModAuditLog.userId, ModNote.authorId, ModNote.userId, NotificationUser.userId, NotificationUserSubscription.userId, PendingTrophy.creatorId, PendingTrophy.declinedByUserId, PendingTrophy.managerId, PendingTrophy.submitterUserId, PendingTrophyApproval.userId, PlayerResult.otherUserId, PlayerResult.ownerUserId, PlusSuggestion.authorId, PlusSuggestion.suggestedId, PlusTier.userId, PlusVote.authorId, PlusVote.votedId, PrivateUserNote.authorId, PrivateUserNote.targetId, ReportedWeapon.userId, SavedCalendarEvent.userId, ScrimMap.reportedByUserId, ScrimPickupRoster.userId, ScrimPickupRosterUser.userId, ScrimPost.canceledByUserId, ScrimPostRequestUser.userId, ScrimPostUser.userId, SeedingSkill.userId, Skill.userId, SkillTeamUser.userId, SpecialTrophyOwner.userId, SplatoonPlayer.userId, TeamEvent.authorId, TeamEventMember.userId, TenStarWeapon.userId, TournamentAuditLog.actorUserId, TournamentAuditLog.subjectUserId, TournamentBadgeOwner.userId, TournamentMatchGameResult.reporterId, TournamentMatchGameResultParticipant.userId, TournamentMatchPickBanEvent.authorId, TournamentMatchScheduleProposal.authorId, TournamentMatchVod.userId, TournamentOrganizationBannedUser.userId, TournamentOrganizationMember.userId, TournamentResult.userId, TournamentStaff.userId, TournamentStreamer.userId, TournamentTeamMember.userId, Trophy.creatorId, Trophy.managerId, TrophyOwner.userId, TrustRelationship.trustGiverUserId, TrustRelationship.trustReceiverUserId, UnvalidatedUserSubmittedImage.submitterUserId, UnvalidatedVideo.submitterUserId, UserFriendCode.submitterUserId, UserFriendCode.userId, UserReport.reportedUserId, UserReport.reporterUserId, UserResultHighlight.userId, UserWeaponPool.userId, UserWidget.userId, VideoMatchPlayer.playerUserId, VoiceClientError.userId, VoiceFeedback.userId, VoiceSession.userId, VoiceSettings.updatedByUserId

UserFriendCode

Rows typed by UserFriendCode

ColumnTypeDescription
friendCodestring
userIdnumber → User
submitterUserIdnumber → User
createdAtGenerated<number>
Used by 19 repository functions · 32 routes

AdminRepository migrate

SQMatchRepository findByIdcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

TournamentRepository findFriendCodesByTournamentId

UserCardRepository findAllByUserIdsfindAllByUserIdsCached

UserRepository findByFriendCodefindLeanByIdfindCurrentFriendCodeByUserIdfindFriendCodesByUserIdfindAllCurrentFriendCodesinsertFriendCode

/admin/lfg/plus/suggestions/plus/suggestions/new/plus/voting/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/scrims/scrims/:id/scrims/new/sendouq/match/:matchId/to/:id/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/join/to/:id/looking/to/:id/matches/:mid/to/:id/register/to/:id/streams/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/upsert/trophies/:id/wins/:userId/u/:identifier/u/:identifier/admin/u/:identifier/edit/user-card/edit/user-report/:id

Relations (2)
erDiagram
  direction LR
  User ||--o{ UserFriendCode : "submitterUserId"
  User ||--o{ UserFriendCode : "userId"

UserReport

Rows typed by UserReport

ColumnTypeDescription
idGeneratedAlways<number>
reportedUserIdnumber → User
reporterUserIdnumber → User
categoryUserReportCategory
descriptionstring
matchIdnumber | null → GroupMatch
createdAtGenerated<number>
Used by 4 repository functions · 3 routes

AdminRepository migrate

UserReportRepository upsertcountRecentByReportedUserIdfindAllByReportedUserId

/admin/u/:identifier/admin/user-report/:id

Relations (3)
erDiagram
  direction LR
  GroupMatch |o--o{ UserReport : "matchId"
  User ||--o{ UserReport : "reportedUserId"
  User ||--o{ UserReport : "reporterUserId"

UserResultHighlight

Rows typed by UserResultHighlight

ColumnTypeDescription
teamIdnumber → CalendarEventResultTeam
userIdnumber → User
Used by 5 repository functions · 3 routes

UserRepository findWidgetsByUserIdfindResultsByUserIdcountResultsByUserIdhasHighlightedResultsByUserIdupdateOwnResultHighlights

/u/:identifier/u/:identifier/results/u/:identifier/results/highlights

Relations (2)
erDiagram
  direction LR
  CalendarEventResultTeam ||--o{ UserResultHighlight : "teamId"
  User ||--o{ UserResultHighlight : "userId"

UserSearch

FTS5 trigram index over User's searchable columns (external content table, kept in sync with triggers). Only meant for reading: filter with match and join rowid to User.id.

Rows typed by UserSearch

ColumnTypeDescription
rowidGeneratedAlways<number>
usernameGeneratedAlways<string | null>
inGameNameGeneratedAlways<string | null>
discordUniqueNameGeneratedAlways<string | null>
customUrlGeneratedAlways<string | null>
Used by 1 repository function · 1 route

UserRepository search

/search

UserSubmittedImage

VIEW over UnvalidatedUserSubmittedImage, excludes images awaiting validation. Insert/update via UnvalidatedUserSubmittedImage.

View of UnvalidatedUserSubmittedImage

Rows typed by UserSubmittedImage

ColumnTypeDescription
idGeneratedAlways<number>
submitterUserIdnumber | null
urlstring
validatedAtnumber | null

Never null in practice, the view filters unvalidated rows out.

Used by 105 repository functions · 119 routes

ExternalStreamRepository findAllfindAllForSidebar

ArtRepository findShowcaseArtsfindShowcaseArtsByTagfindRecentlyUploadedArtsfindArtsByUserId

AssociationRepository findByIdfindByMemberUserIdfindByInviteCode

AvailabilityRepository findAllUpcomingTeamEventsByUserId

BadgeRepository findAllfindById

BuildRepository findPageByWeaponId

CalendarRepository findByIdfindResultsByEventIdfindTopThreeResultsByEventIds

ChatRepository findAllMessagesByRoomIdfindMessageByIdfindAllParticipantsByUserIds

FriendRepository findByUserIdWithActivityfindPendingSentRequestsfindPendingReceivedRequestsfindMutualFriendsfindFriendsByUserId

LeaderboardRepository findTeamLeaderboardBySeasonfindAllXPLeaderboardfindModeXPLeaderboardfindWeaponXPLeaderboardfindUserSPLeaderboard

LFGRepository findBoardPagefindVisibleByIdfindAllOwn

LiveStreamRepository findXRankStreams

PlusSuggestionRepository findAllByMonth

PlusVotingRepository findResultsByMonthYearfindAllUsersForVoting

ScrimPickupRosterRepository findAllOwnRecent

ScrimPostRepository findByIdfindAllRelevantfindAcceptedScrimsBetweenTwoTimestampsfindPendingOverlapsForUsersfindUserScrims

SQGroupRepository findCurrentGroupsfindFriendsAndTeammates

PlayerStatRepository findSeasonMatesEnemiesByUserId

SQMatchRepository findByIdfindSeasonResultsByUserIdcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

QStreamsRepository findAllActiveMatchPlayers

TeamRepository searchByNamefindAllMemberOfByUserIdfindByCustomUrlfindResultsByIdfindAllByMemberUserIdswitchOwnMainTeamdeleteByIdinsertOwnMembershiphandleMemberLeavingupdateRoster

TournamentAuditLogRepository findByTournamentId

TournamentRepository findByIdfindStreamsByTournamentIdfindTeamsFullByTournamentIdfindAllForShowcasefindTopThreeResultsByTournamentIds

TournamentMatchVodRepository findVodsByTournamentId

TournamentLFGRepository findLookingTeamsByTournamentIdfindSubGroups

TournamentMatchRepository findMatchByIdfindByTournamentTeamIdfindScheduleProposalsByMatchId

TournamentOrganizationRepository findBySlugfindByUserIdsearchByNamefindOneByIdfindEventsByMonthfindPaginatedEventsBySeriesfindAllBannedUsersByOrganizationId

TrophyRepository findByIdfindWinsByOwnerfindAllBackfillableTournaments

UserCardRepository findAllByUserIdsfindAllByUserIdsCachedfindCardEditExtrasByUserId

UserRepository findLayoutDataByIdfindProfileByUserIdfindWidgetsByUserIdfindByFriendCodefindLeanByIdfindModInfoByIdfindResultsByUserIdsearchsearchExact

VodRepository findByUserIdfindVodsfindVodById

VoiceRepository findLatestClientErrorsfindLatestFeedbackComments

//admin/admin/streams/admin/voice/api/api/chat/rooms/api/chat/rooms/:id/api/chat/rooms/:id/messages/api/layout/api/status/art/art/new/associations/badges/badges/:id/badges/:id/edit/builds/:slug/calendar/:id/calendar/:id/report-winners/calendar/new/events/friends/friends-for-adding/leaderboards/lfg/lfg/new/org/:id/org/:slug/org/:slug/edit/org/:slug/stats/org/new/plus/suggestions/plus/suggestions/comment/:tier/:userId/plus/suggestions/new/plus/voting/plus/voting/results/q/q/looking/q/match/:id/q/preparing/q/ready/q/streams/refresh-caches/scrims/scrims/:id/scrims/new/search/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/team/:id/to/:id/to/:id/to/:id/admin/to/:id/admin/to/:id/admin/audit/to/:id/admin/brackets/to/:id/admin/import-teams/to/:id/admin/registration/:tid?/to/:id/admin/seeds/to/:id/admin/staff/to/:id/admin/stream/to/:id/brackets/to/:id/brackets/finalize/to/:id/info/to/:id/join/to/:id/looking/to/:id/matches/to/:id/matches/:mid/to/:id/register/to/:id/results/to/:id/rules/to/:id/streams/to/:id/teams/to/:id/teams/:tid/to/:id/teams/:tid/comps/tournament-match/:id/tournament/:id/tournament/:id/brackets/:bidx/tournament/:id/brackets/:bidx/standings/tournament/:id/seeds/tournament/:id/starting-brackets/tournament/:id/teams/tournament/:id/teams/:teamId/add-member/tournament/:id/teams/:teamId/remove-member/tournament/:id/teams/:teamId/update-member-ign/tournament/:id/teams/upsert/trophies/:id/trophies/:id/backfill/:seriesId/trophies/:id/wins/:userId/trophies/new/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/art/u/:identifier/edit/u/:identifier/results/u/:identifier/results/highlights/u/:identifier/seasons/u/:identifier/seasons/u/:identifier/seasons/stats/u/:identifier/seasons/summary-graphic/u/:identifier/vods/user-card/:id/friendship/user-card/edit/user-report/:id/user/:userId/active-match/vods/vods/:id/vods/new

UserWeaponPool

Rows typed by UserWeaponPool

ColumnTypeDescription
userIdnumber → User
sortOrdernumber
weaponSplIdMainWeaponId
isFavoriteGenerated<DBBoolean>
Used by 20 repository functions · 33 routes

LFGRepository findBoardPagefindVisibleByIdfindAllOwn

MatchProfileRepository findSettingsByUserIdfindWeaponPoolByUserIdupdateOwnMatchProfile

SQGroupRepository findCurrentGroups

SQMatchRepository findByIdcancelMatchrequestCancelMatchacceptCancelMatchrefuseCancelMatchreportMapWinnerresolveUnfinishedMatchundoMatchReportundoMapReport

TeamRepository findByCustomUrl

TournamentLFGRepository findLookingTeamsByTournamentIdfindSubGroups

UserRepository findBuildFieldsByUserId

//analyzer/api/layout/api/status/builds/friends/lfg/lfg/new/object-damage-calculator/q/q/looking/q/match/:id/q/preparing/q/ready/refresh-caches/seed/sendouq/active-match/:userId/sendouq/match/:matchId/settings/t/:customUrl/t/:customUrl/t/:customUrl/edit/t/:customUrl/join/t/:customUrl/results/t/:customUrl/roster/t/:customUrl/schedule/t/new/to/:id/looking/to/:id/matches/:mid/u/:identifier/u/:identifier/builds/user/:identifier/user/:userId/active-match

Relations (1)
erDiagram
  direction LR
  User ||--o{ UserWeaponPool : "userId"

UserWidget

Rows typed by UserWidget

ColumnTypeDescription
userIdnumber → User
indexnumber
widgetJSONColumnType<StoredWidget>
Used by 4 repository functions · 3 routes

PlusVotingRepository findAllUsersForVoting

UserRepository upsertWidgetsfindStoredWidgetsByUserIdfindWidgetsByUserId

/plus/voting/u/:identifier/u/:identifier/edit-widgets

Relations (1)
erDiagram
  direction LR
  User ||--o{ UserWidget : "userId"

Video

VIEW over UnvalidatedVideo, excludes videos awaiting validation. Insert/update via UnvalidatedVideo.

View of UnvalidatedVideo

Rows typed by Video

ColumnTypeDescription
eventIdnumber | null
idGeneratedAlways<number>
submitterUserIdnumber
titlestring
type(typeof videoMatchTypes)[number]
validatedAtnumber | null

Never null in practice, the view filters unvalidated rows out.

youtubePublishedAtnumber

When the video was published on YouTube. Day precision only, stored as noon UTC of that day.

youtubeIdstring
Used by 4 repository functions · 5 routes

VodRepository findByUserIdfindVodscountVodsfindVodById

/u/:identifier/u/:identifier/vods/vods/vods/:id/vods/new

VideoMatch

Rows typed by VideoMatch

ColumnTypeDescription
idGeneratedAlways<number>
modeModeShort
stageIdStageId
startsAtnumber
videoIdnumber → UnvalidatedVideo
Used by 7 repository functions · 7 routes

UserRepository findLayoutDataById

VodRepository findByUserIdfindVodscountVodsfindVodByIdupdateinsert

/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/vods/vods/vods/:id/vods/new

Relations (2)
erDiagram
  direction LR
  UnvalidatedVideo ||--o{ VideoMatch : "videoId"
  VideoMatch ||--o{ VideoMatchPlayer : "videoMatchId"

Referenced by VideoMatchPlayer.videoMatchId

VideoMatchPlayer

Rows typed by VideoMatchPlayer

ColumnTypeDescription
playernumber
playerNamestring | null
playerUserIdnumber | null → User
videoMatchIdnumber → VideoMatch
weaponSplIdnumber
Used by 7 repository functions · 7 routes

UserRepository findLayoutDataById

VodRepository findByUserIdfindVodscountVodsfindVodByIdupdateinsert

/u/:identifier/u/:identifier/u/:identifier/admin/u/:identifier/vods/vods/vods/:id/vods/new

Relations (2)
erDiagram
  direction LR
  User |o--o{ VideoMatchPlayer : "playerUserId"
  VideoMatch ||--o{ VideoMatchPlayer : "videoMatchId"

VoiceClientError

Rows typed by VoiceClientError

ColumnTypeDescription
idGeneratedAlways<number>
voiceSessionIdnumber | null → VoiceSession
userIdnumber → User
kindVoiceClientErrorKind
detailstring | null
platformVoicePlatform
createdAtGenerated<number>
Used by 4 repository functions · 2 routes

VoiceRepository countClientErrorsSincefindLatestClientErrorsinsertOwnClientErrordeleteOlderThan

/admin/voice/api/voice/telemetry

Relations (2)
erDiagram
  direction LR
  User ||--o{ VoiceClientError : "userId"
  VoiceSession |o--o{ VoiceClientError : "voiceSessionId"

VoiceFeedback

Rows typed by VoiceFeedback

ColumnTypeDescription
idGeneratedAlways<number>
voiceSessionIdnumber → VoiceSession
userIdnumber → User
ratingnumber

1-5

commentstring | null
createdAtGenerated<number>
Used by 4 repository functions · 3 routes

VoiceRepository hasFeedbackSincecountRatingsSincefindLatestFeedbackCommentsinsertOwnFeedback

/admin/voice/api/voice/rooms/:id/api/voice/telemetry

Relations (2)
erDiagram
  direction LR
  User ||--o{ VoiceFeedback : "userId"
  VoiceSession ||--o| VoiceFeedback : "voiceSessionId"

VoiceSession

Rows typed by VoiceSession

ColumnTypeDescription
idGeneratedAlways<number>
roomIdnumber | null → ChatRoom

null once the chat room has been deleted. The session stays for the statistics.

roomTypeChatRoomType
userIdnumber → User
platformVoicePlatform
eligibleMemberCountnumber

Members of the room who could have joined voice when this session started based on voice chat settings. We need these to check for adoption.

vcPreferenceUserVoiceChat

The joiner's own voice chat setting ({@link User.vc}) when they joined.

dailySessionIdstring | null
createdAtGenerated<number>
connectedAtnumber | null
leftAtnumber | null
durationSecondsnumber | null

Billed seconds in the call as reported by Daily, null until its webhook connects.

leaveReasonVoiceLeaveReason | null
networkQualityStateVoiceNetworkQualityState | null
lowQualitySecondsGenerated<number>
talkSecondsGenerated<number>
inputModeVoiceInputMode | null
Used by 17 repository functions · 5 routes

VoiceRepository sumParticipantMinutesSincehasBeenKickedfindOwnSessionByIdfindDailyAdoptionSincefindPlayerAdoptionSincefindVoiceChatPreferenceStatsSincefindPlatformStatsSincecountLeaveReasonsSincefindLatestFeedbackCommentsinsertOwnSessionmarkOwnSessionConnectedupdateOwnSessionSummarymarkOwnSessionLeftmarkSessionsLefthasOtherConnectedSessionupdateFromLeftWebhookdeleteOlderThan

/admin/voice/api/voice/rooms/:id/api/voice/telemetry/api/voice/webhook/q/looking

Relations (4)
erDiagram
  direction LR
  ChatRoom |o--o{ VoiceSession : "roomId"
  User ||--o{ VoiceSession : "userId"
  VoiceSession |o--o{ VoiceClientError : "voiceSessionId"
  VoiceSession ||--o| VoiceFeedback : "voiceSessionId"

Referenced by VoiceClientError.voiceSessionId, VoiceFeedback.voiceSessionId

VoiceSettings

Rows typed by VoiceSettings

ColumnTypeDescription
idGeneratedAlways<number>
isDisabledGenerated<DBBoolean>

Manual kill switch.

updatedAtnumber | null
updatedByUserIdnumber | null → User
Used by 2 repository functions · 2 routes

VoiceRepository findSettingsupdateSettings

/admin/voice/api/voice/rooms/:id

Relations (1)
erDiagram
  direction LR
  User |o--o{ VoiceSettings : "updatedByUserId"

XRankPlacement

Rows typed by XRankPlacement

ColumnTypeDescription
badgesstring
bannerSplIdnumber
idGeneratedAlways<number>
modeModeShort
monthnumber
namestring
nameDiscriminatorstring
playerIdnumber → SplatoonPlayer
powernumber
ranknumber
regionXRankPlacementRegion
titlestring
weaponSplIdMainWeaponId
yearnumber
Used by 22 repository functions · 24 routes

BuildRepository insertupdaterecalculateAllSortValues

LeaderboardRepository findAllXPLeaderboardfindModeXPLeaderboardfindWeaponXPLeaderboard

XRankPlacementRepository insertManydeleteAllByMonthYearfindPlacementsOfMonthfindPlacementsByPlayerIdfindPlacementsByUserIdfindAllMonthYearsfindPeaksByUserIdrefreshAllPeakXprefreshTenStarWeapons

TrophyRepository findByOwnerUserIdfindByOwnerUserIdIncludingHiddenfindXpWeaponCountsByIdsyncSpecialTrophies

UserCardRepository findAllByUserIdsfindAllByUserIdsCachedfindVerifiedXpByUserId

/admin/leaderboards/lfg/player/:id/plus/suggestions/plus/voting/q/looking/q/match/:id/q/ready/q/streams/scrims/scrims/:id/to/:id/admin/seeds/to/:id/looking/to/:id/matches/:mid/to/:id/streams/trophies/:id/trophies/:id/placements/:userId/trophies/:id/wins/:userId/u/:identifier/u/:identifier/builds/new/u/:identifier/edit/user-card/edit/xsearch

Relations (1)
erDiagram
  direction LR
  SplatoonPlayer ||--o{ XRankPlacement : "playerId"