217 lines
6 KiB
Text
217 lines
6 KiB
Text
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
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")
|
|
}
|
|
|
|
/// 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")
|
|
@@map("beatmapset_nominators")
|
|
@@ignore
|
|
}
|
|
|
|
model Blacklist {
|
|
UserID Int @id
|
|
|
|
@@map("blacklist")
|
|
}
|
|
|
|
model Comment {
|
|
CommentID Int @id @default(autoincrement())
|
|
UserID Int
|
|
SetID Int
|
|
Comment String? @db.Text
|
|
date DateTime? @default(now()) @db.Timestamp(0)
|
|
|
|
@@map("comments")
|
|
}
|
|
|
|
model DescriptorVote {
|
|
VoteID Int @id @default(autoincrement())
|
|
BeatmapID Int
|
|
UserID Int
|
|
Vote Boolean
|
|
DescriptorID Int
|
|
|
|
@@unique([BeatmapID, UserID, DescriptorID], map: "descriptor_votes_pk2")
|
|
@@index([BeatmapID], map: "descriptor_votes_BeatmapID_index")
|
|
@@map("descriptor_votes")
|
|
}
|
|
|
|
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")
|
|
}
|
|
|
|
model Log {
|
|
LogID Int @id @default(autoincrement())
|
|
UserID Int
|
|
LogData Json?
|
|
|
|
@@map("logs")
|
|
}
|
|
|
|
model MapperName {
|
|
UserID Int @id
|
|
Username String? @db.VarChar(255)
|
|
|
|
@@map("mappernames")
|
|
}
|
|
|
|
model RatingTag {
|
|
UserID Int?
|
|
BeatmapID Int?
|
|
Tag String? @db.VarChar(150)
|
|
TagID Int @id @default(autoincrement())
|
|
|
|
@@unique([BeatmapID, UserID, Tag], map: "rating_tags_pk")
|
|
@@map("rating_tags")
|
|
}
|
|
|
|
model Rating {
|
|
RatingID Int @id @default(autoincrement())
|
|
BeatmapID Int
|
|
UserID Int
|
|
Score Decimal? @db.Decimal(2, 1)
|
|
date DateTime @db.DateTime(0)
|
|
|
|
@@index([BeatmapID], map: "idx_beatmapID")
|
|
@@map("ratings")
|
|
}
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
|
model SetRetrieveInfo {
|
|
LastRetrieval DateTime? @db.DateTime(0)
|
|
LastDate DateTime? @db.Date
|
|
|
|
@@map("setretrieveinfo")
|
|
@@ignore
|
|
}
|
|
|
|
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
|
|
model UserCorrelation {
|
|
user1_id Int?
|
|
user2_id Int?
|
|
correlation Float? @db.Float
|
|
|
|
@@unique([user1_id, user2_id], map: "user_correlations_pk")
|
|
@@map("user_correlations")
|
|
@@ignore
|
|
}
|
|
|
|
/// 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 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")
|
|
}
|