-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
62 lines (56 loc) · 1.73 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongoDb"]
}
model User {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
createdAt DateTime @default(now())
email String @unique
password String
name String?
servers Server[]
Vote Vote[]
}
model Server {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
createdAt DateTime @default(now())
openingAt DateTime?
approved Boolean @default(false)
name String
description String?
chronicle Chronicle @relation(fields: [chronicleId], references: [id])
addedBy User @relation(fields: [addedById], references: [id])
addedById String @db.ObjectId
chronicleId String @db.ObjectId
rates ServerRates @relation(fields: [serverRatesId], references: [id])
serverRatesId String @db.ObjectId
Vote Vote[]
}
model ServerRates {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
xp Int
sp Int
adena Int
drop Int
spoil Int
Server Server[]
}
model Chronicle {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
name String
shortcut String? @unique
Server Server[]
}
model Vote {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
createdAt DateTime @default(now())
votedBy User? @relation(fields: [votedByUserId], references: [id])
votedByUserId String? @db.ObjectId
server Server @relation(fields: [serverId], references: [id])
serverId String @db.ObjectId
ip String
}