-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.prisma
60 lines (54 loc) · 1.51 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
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_VERCEL_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_VERCEL_URL_NON_POOLING") // uses a direct connection
}
model User {
id Int @id @default(autoincrement())
name String @unique
email String @unique
createdAt DateTime @default(now())
curator Curator?
admin Admin?
UserFeedbackOnJobs UserFeedbackOnJobs[]
}
model Curator {
id Int @id @default(autoincrement())
name String @unique
User User @relation(fields: [name], references: [name])
profile String @default("")
jobsPosted Jobs[]
}
model Jobs {
id Int @id @default(autoincrement())
title String
company String
body String
blob String @unique
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
curator Curator @relation(fields: [curatorId], references: [id])
curatorId Int
isOpen Boolean @default(true)
UserFeedbackOnJobs UserFeedbackOnJobs[]
}
model Admin {
id Int @id @default(autoincrement())
name String @unique
User User @relation(fields: [name], references: [name])
isSuperAdmin Boolean @default(false)
}
model UserFeedbackOnJobs {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
job Jobs @relation(fields: [jobId], references: [id])
jobId Int
isOpen Boolean?
isLegit Boolean?
isInternational Boolean?
@@unique([userId, jobId])
}