This repository was archived by the owner on Feb 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
executable file
·127 lines (112 loc) · 5.13 KB
/
schema.prisma
File metadata and controls
executable file
·127 lines (112 loc) · 5.13 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// This file is automatically generated by Keystone, do not modify it manually.
// Modify your Keystone config when you want to change this.
datasource postgresql {
url = env("DATABASE_URL")
provider = "postgresql"
}
generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}
model Badge {
id String @id @default(uuid()) @postgresql.Uuid
image String @default("")
label String @default("")
description String @default("")
owner User? @relation("Badge_owner", fields: [ownerId], references: [id])
ownerId String? @map("owner") @postgresql.Uuid
from_User_rep_badge User[] @relation("User_rep_badge")
@@index([ownerId])
}
model Comment {
id String @id @default(uuid()) @postgresql.Uuid
content String @default("")
author User? @relation("Comment_author", fields: [authorId], references: [id])
authorId String? @map("author") @postgresql.Uuid
post Post? @relation("Comment_post", fields: [postId], references: [id])
postId String? @map("post") @postgresql.Uuid
created_at DateTime? @updatedAt
@@index([authorId])
@@index([postId])
}
model Difficulty {
id String @id @default(uuid()) @postgresql.Uuid
label String @default("")
numeric_level Int @unique
from_Recipe_difficulty Recipe[] @relation("Recipe_difficulty")
}
model MeatType {
id String @id @default(uuid()) @postgresql.Uuid
label String @default("")
from_Recipe_meat_type Recipe[] @relation("Recipe_meat_type")
}
model Post {
id String @id @default(uuid()) @postgresql.Uuid
title String @default("")
photo String @default("")
content String @default("")
author User? @relation("Post_author", fields: [authorId], references: [id])
authorId String? @map("author") @postgresql.Uuid
hearted_user User[] @relation("Post_hearted_user_User_hearted_post")
linked_recipe Recipe? @relation("Post_linked_recipe", fields: [linked_recipeId], references: [id])
linked_recipeId String? @map("linked_recipe") @postgresql.Uuid
bookmarked_user User[] @relation("User_bookmarked_post")
comment Comment[] @relation("Comment_post")
created_at DateTime? @updatedAt
@@index([authorId])
@@index([linked_recipeId])
}
model Recipe {
id String @id @default(uuid()) @postgresql.Uuid
thumbnail String @default("")
name String @default("")
description String @default("")
author User? @relation("Recipe_author", fields: [authorId], references: [id])
authorId String? @map("author") @postgresql.Uuid
duration Int
difficulty Difficulty? @relation("Recipe_difficulty", fields: [difficultyId], references: [id])
difficultyId String? @map("difficulty") @postgresql.Uuid
hearted_user User[] @relation("Recipe_hearted_user_User_hearted_recipe")
youtube String @default("")
ingredient Json?
linked_post Post[] @relation("Post_linked_recipe")
created_at DateTime? @updatedAt
meat_type MeatType? @relation("Recipe_meat_type", fields: [meat_typeId], references: [id])
meat_typeId String? @map("meat_type") @postgresql.Uuid
bookmarked_user User[] @relation("User_bookmarked_recipe")
steps Json?
@@index([authorId])
@@index([difficultyId])
@@index([meat_typeId])
}
model User {
id String @id @default(uuid()) @postgresql.Uuid
name String @default("")
photo String @default("https://picsum.photos/200")
email String @unique @default("")
password String
uploaded_posts Post[] @relation("Post_author")
uploaded_recipe Recipe[] @relation("Recipe_author")
rep_badge Badge? @relation("User_rep_badge", fields: [rep_badgeId], references: [id])
rep_badgeId String? @map("rep_badge") @postgresql.Uuid
badge_list Badge[] @relation("Badge_owner")
hearted_post Post[] @relation("Post_hearted_user_User_hearted_post")
hearted_recipe Recipe[] @relation("Recipe_hearted_user_User_hearted_recipe")
uploaded_comment Comment[] @relation("Comment_author")
bookmarked_post Post? @relation("User_bookmarked_post", fields: [bookmarked_postId], references: [id])
bookmarked_postId String? @map("bookmarked_post") @postgresql.Uuid
bookmarked_recipe Recipe? @relation("User_bookmarked_recipe", fields: [bookmarked_recipeId], references: [id])
bookmarked_recipeId String? @map("bookmarked_recipe") @postgresql.Uuid
created_at DateTime? @updatedAt
@@index([rep_badgeId])
@@index([bookmarked_postId])
@@index([bookmarked_recipeId])
}
model Ad {
id String @id @default(uuid()) @postgresql.Uuid
image String @default("")
title String @default("")
description String @default("")
target_url String @default("")
}