-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
77 lines (66 loc) · 2.92 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// 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"
}
model User {
id String @id @default(cuid())
name String @default("")
email String @unique @default("")
password String
product User[] @relation("User_product")
from_User_product User[] @relation("User_product")
}
model Product {
id String @id @default(cuid())
name String @default("")
manufacturer Manufacturer? @relation("Product_manufacturer", fields: [manufacturerId], references: [id])
manufacturerId String? @map("manufacturer")
summary String @default("")
description Json @default("[{\"type\":\"paragraph\",\"children\":[{\"text\":\"\"}]}]")
status String? @default("draft")
productImage_filesize Int?
productImage_extension String?
productImage_width Int?
productImage_height Int?
productImage_mode String?
productImage_id String?
prices VariantPrice[] @relation("Product_prices")
sale String? @default("draft")
saleStart DateTime?
saleEnd DateTime?
salePrices VariantPrice[] @relation("Product_salePrices")
@@index([manufacturerId])
}
model Variant {
id String @id @default(cuid())
name String @default("")
from_ProductVariant_variant ProductVariant[] @relation("ProductVariant_variant")
}
model ProductVariant {
id String @id @default(cuid())
variant Variant? @relation("ProductVariant_variant", fields: [variantId], references: [id])
variantId String? @map("variant")
value String @unique @default("")
from_VariantPrice_variant VariantPrice[] @relation("VariantPrice_variant")
@@index([variantId])
}
model VariantPrice {
id String @id @default(cuid())
variant ProductVariant? @relation("VariantPrice_variant", fields: [variantId], references: [id])
variantId String? @map("variant")
price Decimal? @postgresql.Decimal(7, 2)
from_Product_prices Product[] @relation("Product_prices")
from_Product_salePrices Product[] @relation("Product_salePrices")
@@index([variantId])
}
model Manufacturer {
id String @id @default(cuid())
name String @default("")
from_Product_manufacturer Product[] @relation("Product_manufacturer")
}