2023-09-05 21:42:50 +00:00
|
|
|
generator client {
|
2023-09-06 01:45:38 +00:00
|
|
|
provider = "prisma-client-js"
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
2023-09-06 01:45:38 +00:00
|
|
|
provider = "mysql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
model ApiKey {
|
|
|
|
ApiID Int @id @default(autoincrement())
|
|
|
|
Name String? @db.Text
|
|
|
|
ApiKey String? @unique(map: "ApiKey", length: 255) @db.Text
|
|
|
|
UserID Int?
|
|
|
|
|
|
|
|
@@map("apikeys")
|
|
|
|
}
|
|
|
|
|
|
|
|
model BeatmapCreator {
|
|
|
|
BeatmapID Int
|
|
|
|
CreatorID Int
|
|
|
|
|
|
|
|
@@id([BeatmapID, CreatorID])
|
|
|
|
@@index([BeatmapID], map: "idx_BeatmapID")
|
|
|
|
@@map("beatmap_creators")
|
|
|
|
}
|
|
|
|
|
|
|
|
model BeatmapEditRequest {
|
|
|
|
EditID Int @id @default(autoincrement())
|
|
|
|
BeatmapID Int?
|
|
|
|
SetID Int?
|
|
|
|
UserID Int
|
|
|
|
EditData Json
|
|
|
|
Timestamp DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
Status BeatmapEditRequestStatus? @default(Pending)
|
|
|
|
EditorID Int?
|
|
|
|
|
|
|
|
@@map("beatmap_edit_requests")
|
|
|
|
}
|
|
|
|
|
|
|
|
model Beatmap {
|
|
|
|
BeatmapID Int @id @db.UnsignedMediumInt
|
|
|
|
SetID Int? @db.UnsignedMediumInt
|
|
|
|
SetCreatorID Int?
|
|
|
|
DifficultyName String? @db.VarChar(255)
|
|
|
|
Mode Int @default(0) @db.UnsignedTinyInt
|
|
|
|
Status Int @default(0) @db.TinyInt
|
|
|
|
SR Float @default(0) @db.Float
|
|
|
|
Rating String? @db.VarChar(45)
|
|
|
|
ChartRank Int?
|
|
|
|
ChartYearRank Int?
|
|
|
|
Timestamp DateTime? @default(now()) @db.Timestamp(0)
|
|
|
|
RatingCount Int?
|
|
|
|
WeightedAvg Float? @db.Float
|
|
|
|
Genre Int?
|
|
|
|
Lang Int?
|
|
|
|
Artist String? @db.VarChar(255)
|
|
|
|
Title String? @db.VarChar(255)
|
|
|
|
DateRanked DateTime? @db.Timestamp(0)
|
|
|
|
Blacklisted Boolean @default(false)
|
|
|
|
BlacklistReason String? @db.Text
|
|
|
|
controversy Decimal? @db.Decimal(10, 8)
|
|
|
|
|
|
|
|
@@index([DifficultyName, Artist, Title], map: "Artist")
|
|
|
|
@@index([SetID], map: "beatmapset_id")
|
|
|
|
@@map("beatmaps")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
2023-09-06 01:45:38 +00:00
|
|
|
model BeatmapSetNominator {
|
|
|
|
SetID Int?
|
|
|
|
NominatorID Int?
|
|
|
|
Mode Int?
|
2023-09-05 21:42:50 +00:00
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
@@unique([SetID, NominatorID, Mode], map: "beatmapset_nominators_pk")
|
|
|
|
@@index([SetID], map: "beatmapset_nominators_SetID_index")
|
|
|
|
@@map("beatmapset_nominators")
|
|
|
|
@@ignore
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model Blacklist {
|
|
|
|
UserID Int @id
|
|
|
|
|
|
|
|
@@map("blacklist")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model Comment {
|
|
|
|
CommentID Int @id @default(autoincrement())
|
|
|
|
UserID Int
|
|
|
|
SetID Int
|
|
|
|
Comment String? @db.Text
|
|
|
|
date DateTime? @default(now()) @db.Timestamp(0)
|
|
|
|
|
|
|
|
@@map("comments")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model DescriptorVote {
|
|
|
|
VoteID Int @id @default(autoincrement())
|
|
|
|
BeatmapID Int
|
|
|
|
UserID Int
|
|
|
|
Vote Boolean
|
|
|
|
DescriptorID Int
|
2023-09-05 21:42:50 +00:00
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
@@unique([BeatmapID, UserID, DescriptorID], map: "descriptor_votes_pk2")
|
|
|
|
@@index([BeatmapID], map: "descriptor_votes_BeatmapID_index")
|
|
|
|
@@map("descriptor_votes")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
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)
|
|
|
|
|
|
|
|
@@map("descriptors")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model Log {
|
|
|
|
LogID Int @id @default(autoincrement())
|
|
|
|
UserID Int
|
|
|
|
LogData Json?
|
|
|
|
|
|
|
|
@@map("logs")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model MapperName {
|
|
|
|
UserID Int @id
|
|
|
|
Username String? @db.VarChar(255)
|
|
|
|
|
|
|
|
@@map("mappernames")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model RatingTag {
|
|
|
|
UserID Int?
|
|
|
|
BeatmapID Int?
|
|
|
|
Tag String? @db.VarChar(150)
|
|
|
|
TagID Int @id @default(autoincrement())
|
2023-09-05 21:42:50 +00:00
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
@@unique([BeatmapID, UserID, Tag], map: "rating_tags_pk")
|
|
|
|
@@map("rating_tags")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
model Rating {
|
|
|
|
RatingID Int @id @default(autoincrement())
|
|
|
|
BeatmapID Int
|
|
|
|
UserID Int
|
|
|
|
Score Decimal? @db.Decimal(2, 1)
|
|
|
|
date DateTime @db.DateTime(0)
|
2023-09-05 21:42:50 +00:00
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
@@index([BeatmapID], map: "idx_beatmapID")
|
|
|
|
@@map("ratings")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
2023-09-06 01:45:38 +00:00
|
|
|
model SetRetrieveInfo {
|
|
|
|
LastRetrieval DateTime? @db.DateTime(0)
|
|
|
|
LastDate DateTime? @db.Date
|
2023-09-05 21:42:50 +00:00
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
@@map("setretrieveinfo")
|
|
|
|
@@ignore
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
2023-09-06 01:45:38 +00:00
|
|
|
model UserCorrelation {
|
|
|
|
user1_id Int?
|
|
|
|
user2_id Int?
|
|
|
|
correlation Float? @db.Float
|
2023-09-05 21:42:50 +00:00
|
|
|
|
2023-09-06 01:45:38 +00:00
|
|
|
@@unique([user1_id, user2_id], map: "user_correlations_pk")
|
|
|
|
@@map("user_correlations")
|
|
|
|
@@ignore
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
2023-09-06 01:45:38 +00:00
|
|
|
model UserRelation {
|
|
|
|
UserIDFrom Int?
|
|
|
|
UserIDTo Int?
|
|
|
|
type Int?
|
|
|
|
|
|
|
|
@@unique([UserIDTo, UserIDFrom], map: "user_relations_pk")
|
|
|
|
@@map("user_relations")
|
|
|
|
@@ignore
|
|
|
|
}
|
|
|
|
|
|
|
|
model User {
|
|
|
|
UserID Int @id
|
|
|
|
Username String? @db.VarChar(255)
|
|
|
|
AccessToken String? @db.VarChar(2000)
|
|
|
|
RefreshToken String? @db.VarChar(2000)
|
|
|
|
banned Boolean? @default(false)
|
|
|
|
Weight Decimal? @db.Decimal(6, 4)
|
|
|
|
DoTrueRandom Boolean @default(false)
|
|
|
|
Custom00Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom05Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom10Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom15Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom20Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom25Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom30Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom35Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom40Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom45Rating String @default("") @db.VarChar(60)
|
|
|
|
Custom50Rating String @default("") @db.VarChar(60)
|
|
|
|
LastAccessedSite DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
HideRatings Boolean? @default(false)
|
|
|
|
|
|
|
|
@@map("users")
|
|
|
|
}
|
|
|
|
|
|
|
|
enum BeatmapEditRequestStatus {
|
|
|
|
Pending
|
|
|
|
Denied
|
|
|
|
Approved
|
|
|
|
|
|
|
|
@@map("beatmap_edit_requests_Status")
|
2023-09-05 21:42:50 +00:00
|
|
|
}
|