-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
54 lines (49 loc) · 1.43 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
datasource db {
provider = "cockroachdb"
url = env("DATABASE_URL")
}
generator db {
provider = "go run github.com/steebchen/prisma-client-go"
}
model User {
UserID String @id @default(cuid())
LastName String
FirstName String
ProfilePicture String
Location String
Bio String
Email String @unique
Username String @unique
posts Post[]
comments Comment[]
books Book[]
}
model Post {
PostID String @id @default(cuid())
Picture String
Description String
Duration String
RequirementsAndRestriction String
Location String
Cost String
comments Comment[]
user User @relation(fields: [UserID], references: [UserID])
UserID String
books Book[]
}
model Comment {
CommentID String @id @default(cuid())
Content String
user User @relation(fields: [UserID], references: [UserID])
UserID String
post Post @relation(fields: [PostID], references: [PostID])
PostID String
}
model Book {
BookID String @id @default(cuid())
Title String
post Post @relation(fields: [PostID], references: [PostID])
PostID String
user User @relation(fields: [UserID], references: [UserID])
UserID String
}