-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.prisma
83 lines (75 loc) · 1.9 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
78
79
80
81
82
83
datasource db {
provider = "postgresql"
url = env("DB_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
createdAt DateTime @default(now())
firstName String?
id String @id @default(cuid())
lastName String?
password String
roles Json
updatedAt DateTime @updatedAt
username String @unique
}
model Order {
createdAt DateTime @default(now())
customer Customer? @relation(fields: [customerId], references: [id])
customerId String?
discount Float?
id String @id @default(cuid())
product Product? @relation(fields: [productId], references: [id])
productId String?
quantity Int?
totalPrice Int?
updatedAt DateTime @updatedAt
}
model Customer {
address Address? @relation(fields: [addressId], references: [id])
addressId String?
createdAt DateTime @default(now())
email String?
firstName String?
id String @id @default(cuid())
lastName String?
orders Order[]
payments Payment[]
phone String?
updatedAt DateTime @updatedAt
}
model Address {
address_1 String?
address_2 String?
city String?
createdAt DateTime @default(now())
customers Customer[]
id String @id @default(cuid())
state String?
updatedAt DateTime @updatedAt
zip Int?
}
model Product {
createdAt DateTime @default(now())
description String?
id String @id @default(cuid())
itemPrice Float?
name String?
orders Order[]
updatedAt DateTime @updatedAt
}
model Payment {
createdAt DateTime @default(now())
customer Customer? @relation(fields: [customerId], references: [id])
customerId String?
id String @id @default(cuid())
paymentType EnumPaymentPaymentType?
updatedAt DateTime @updatedAt
}
enum EnumPaymentPaymentType {
Card
Cash
Paypal
}