-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
50 lines (44 loc) · 1.18 KB
/
schema.prisma
File metadata and controls
50 lines (44 loc) · 1.18 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
// schema.prisma
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
name String
lastname String
email String
password String
}
model Product {
id Int @id @default(autoincrement())
productName String
productDescription String?
price Float
stock Int
discount Float?
sku String?
dues Int?
imageFront String?
imageBack String?
category Category? @relation(fields: [categoryId], references: [id])
categoryId Int?
licence Licence? @relation(fields: [licenceId], references: [id])
licenceId Int?
}
model Category {
id Int @id @default(autoincrement())
categoryName String
products Product[]
}
model Licence {
id Int @id @default(autoincrement())
licenceName String
licenceDescription String?
licenceImage String?
products Product[]
}