-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.diagram.txt
135 lines (112 loc) · 1.97 KB
/
db.diagram.txt
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
128
129
130
131
132
133
134
135
https://dbdiagram.io/d/614b2989825b5b01460e65f4
table products
{
id integer
name string
description text
price integer
price_discount integer
stock integer
publisher string
release_date datetime
slug string
sold integer
vat integer
}
table categories //connected to product through pivot table
{
id integer
name string
slug string
}
table adresses
{
id integer
user_id integer
country string
address_1 string
address_2 string
zipcode string
city string
billing_address boolean
}
table images
{
id integer
product_id integer
alt string
location string
width integer
height string
box boolean
}
table orders
{
id integer
user_id integer
shipping_method_id integer
payment_method_id integer
shipping_address integer
status enum
date datetime
user_note text
total_price integer
total_vat integer
}
table order_product
{
id integer
order_id integer
product_id integer
amount integer
}
table payment_methods
{
id integer
payment_method enum
}
table platforms //connected to product through pivot table
{
id integer
platform string
}
table ratings
{
id integer
user_id integer
product_id integer
username string
rating integer
review text
}
table shipping_methods
{
id integer
shipping_method string
shipping_cost integer
time string
}
table users
{
id integer
first_name string
last_name string
username string
slug string
email string
phone string
gender string
birthdate datetime
registered integer
company string
email_verified_at datetime
password string
}
Ref: "ratings"."user_id" < "users"."id"
Ref: "adresses"."user_id" < "ratings"."user_id"
Ref: "images"."product_id" < "products"."id"
Ref: "orders"."user_id" < "adresses"."user_id"
Ref: "orders"."payment_method_id" < "payment_methods"."id"
Ref: "orders"."shipping_method_id" < "shipping_methods"."id"
Ref: "order_product"."order_id" < "orders"."id"
Ref: "order_product"."product_id" < "products"."id"