231 lines
6.2 KiB
Text
231 lines
6.2 KiB
Text
generator client {
|
|
provider = "prisma-client-js"
|
|
previewFeatures = ["fullTextIndex"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model ApiKey {
|
|
ApiKey String @id
|
|
Name String
|
|
UserID Int
|
|
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
}
|
|
|
|
model BeatmapCreator {
|
|
BeatmapID Int
|
|
CreatorID Int
|
|
|
|
@@id([BeatmapID, CreatorID])
|
|
@@index([BeatmapID], map: "idx_BeatmapID")
|
|
}
|
|
|
|
model BeatmapEditRequest {
|
|
EditID Int @id @default(autoincrement())
|
|
BeatmapID Int
|
|
UserID Int
|
|
EditData Json
|
|
Timestamp DateTime @default(now())
|
|
Status BeatmapEditRequestStatus @default(Pending)
|
|
EditorID Int?
|
|
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
}
|
|
|
|
model Beatmap {
|
|
BeatmapID Int @id
|
|
SetID Int
|
|
|
|
DifficultyName String
|
|
Mode Int
|
|
Status Int
|
|
SR Float
|
|
Rating String? @db.VarChar(45)
|
|
ChartRank Int?
|
|
ChartYearRank Int?
|
|
Timestamp DateTime? @default(now()) @db.Timestamp(0)
|
|
RatingCount Int?
|
|
WeightedAvg Float? @db.Float
|
|
Blacklisted Boolean @default(false)
|
|
BlacklistReason String? @db.Text
|
|
controversy Decimal? @db.Decimal(10, 8)
|
|
|
|
BeatmapSet BeatmapSet @relation(fields: [SetID], references: [SetID])
|
|
RatingTags RatingTag[]
|
|
DescriptorVotes DescriptorVote[]
|
|
Ratings Rating[]
|
|
}
|
|
|
|
model BeatmapSet {
|
|
SetID Int @id
|
|
HostID Int
|
|
|
|
Genre Int
|
|
Lang Int
|
|
|
|
Artist String
|
|
ArtistUnicode String
|
|
Title String
|
|
TitleUnicode String
|
|
DateRanked DateTime @db.Timestamp(0)
|
|
|
|
Host OsuUser @relation(fields: [HostID], references: [UserID])
|
|
Beatmaps Beatmap[]
|
|
Comments Comment[]
|
|
|
|
@@fulltext([Title, Artist])
|
|
}
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
|
model BeatmapSetNominator {
|
|
SetID Int?
|
|
NominatorID Int?
|
|
Mode Int?
|
|
|
|
@@unique([SetID, NominatorID, Mode], map: "beatmapset_nominators_pk")
|
|
@@index([SetID], map: "beatmapset_nominators_SetID_index")
|
|
@@ignore
|
|
}
|
|
|
|
model Comment {
|
|
CommentID Int @id @default(autoincrement())
|
|
UserID Int
|
|
SetID Int
|
|
Content String
|
|
DatePosted DateTime @default(now())
|
|
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
BeatmapSet BeatmapSet @relation(fields: [SetID], references: [SetID])
|
|
}
|
|
|
|
model DescriptorVote {
|
|
VoteID Int @id @default(autoincrement())
|
|
BeatmapID Int
|
|
UserID Int
|
|
Vote Boolean
|
|
DescriptorID Int
|
|
|
|
Beatmap Beatmap @relation(fields: [BeatmapID], references: [BeatmapID])
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
Descriptor Descriptor @relation(fields: [DescriptorID], references: [DescriptorID])
|
|
|
|
@@unique([BeatmapID, UserID, DescriptorID], map: "descriptor_votes_pk2")
|
|
}
|
|
|
|
model Descriptor {
|
|
DescriptorID Int @id @default(autoincrement())
|
|
Name String @unique(map: "descriptors_pk2") @db.VarChar(40)
|
|
ShortDescription String? @db.Text
|
|
ParentID Int?
|
|
Usable Boolean @default(true)
|
|
|
|
DescriptorVote DescriptorVote[]
|
|
}
|
|
|
|
model Log {
|
|
LogID Int @id @default(autoincrement())
|
|
UserID Int
|
|
LogData Json
|
|
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
}
|
|
|
|
model RatingTag {
|
|
TagID Int @id @default(autoincrement())
|
|
UserID Int
|
|
BeatmapID Int
|
|
Tag String
|
|
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
Beatmap Beatmap @relation(fields: [BeatmapID], references: [BeatmapID])
|
|
|
|
@@unique([BeatmapID, UserID, Tag])
|
|
}
|
|
|
|
model Rating {
|
|
RatingID Int @id @default(autoincrement())
|
|
BeatmapID Int
|
|
UserID Int
|
|
Score Decimal @db.Decimal(2, 1)
|
|
DateRated DateTime
|
|
|
|
Beatmap Beatmap @relation(fields: [BeatmapID], references: [BeatmapID])
|
|
User OmdbUser @relation(fields: [UserID], references: [UserID])
|
|
}
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
|
model SetRetrieveInfo {
|
|
Id Int @id
|
|
LastRetrieval DateTime
|
|
LastDate DateTime
|
|
}
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
|
model UserCorrelation {
|
|
User1ID Int
|
|
User2ID Int
|
|
|
|
Correlation Float
|
|
Data Json
|
|
|
|
User1 OmdbUser @relation(name: "user1", fields: [User1ID], references: [UserID])
|
|
User2 OmdbUser @relation(name: "user2", fields: [User2ID], references: [UserID])
|
|
|
|
@@unique([User1ID, User2ID], map: "user_correlations_pk")
|
|
}
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
|
model UserRelation {
|
|
UserIDFrom Int?
|
|
UserIDTo Int?
|
|
type Int?
|
|
|
|
@@unique([UserIDTo, UserIDFrom], map: "user_relations_pk")
|
|
@@map("user_relations")
|
|
@@ignore
|
|
}
|
|
|
|
model OmdbUser {
|
|
UserID Int @id
|
|
|
|
AccessToken String
|
|
RefreshToken String
|
|
|
|
Weight Decimal @db.Decimal(6, 4)
|
|
DoTrueRandom Boolean @default(false)
|
|
CustomRatings Json @default("{}")
|
|
LastAccessedSite DateTime @default(now())
|
|
HideRatings Boolean @default(false)
|
|
|
|
IsBlacklisted Boolean @default(false)
|
|
|
|
ApiKeys ApiKey[]
|
|
OsuUser OsuUser @relation(fields: [UserID], references: [UserID])
|
|
RatingTags RatingTag[]
|
|
BeatmapEditRequests BeatmapEditRequest[]
|
|
Comments Comment[]
|
|
DescriptorVotes DescriptorVote[]
|
|
Ratings Rating[]
|
|
Log Log[]
|
|
User1Correlation UserCorrelation[] @relation("user1")
|
|
User2Correlation UserCorrelation[] @relation("user2")
|
|
}
|
|
|
|
model OsuUser {
|
|
UserID Int @id
|
|
Username String @db.VarChar(255)
|
|
Banned Boolean @default(false)
|
|
|
|
OmdbUser OmdbUser?
|
|
HostedBeatmapSets BeatmapSet[]
|
|
}
|
|
|
|
enum BeatmapEditRequestStatus {
|
|
Pending
|
|
Denied
|
|
Approved
|
|
}
|