-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdiagram.dbml
116 lines (103 loc) · 2.08 KB
/
diagram.dbml
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
Table directus_files {
id varchar
}
Table products {
id int [pk]
name varchar
description text
thumbnail varchar [ref: > directus_files.id]
status varchar
price decimal
type int [ref: > product_types.id]
category int [ref: > product_categories.id]
}
Table product_media {
id int [pk]
product int [ref: > products.id]
directus_file varchar [ref: > directus_files.id]
}
Table product_variants {
id int [pk]
sku varchar [unique]
product int [ref: > products.id]
price decimal
thumbnail varchar [ref: > directus_files.id]
}
Table product_types {
id int [pk]
name varchar
description varchar
icon varchar
thumbnail varchar
}
Table product_categories {
id int [pk]
name varchar
description varchar
icon varchar
thumbnail varchar [ref: > directus_files.id]
parent int [ref: > product_categories.id]
}
Table product_tags {
id int [pk]
name varchar
description varchar
icon varchar
thumbnail varchar [ref: > directus_files.id]
}
Table products_product_tags {
id int [pk]
product int [ref: > products.id]
product_tag int [ref: > product_tags.id]
}
Table inventory_items {
id int [pk]
variant int [ref: > product_variants.id]
available int
location int [ref: > locations.id]
}
Table locations {
id int [pk]
name varchar
address1 varchar
address2 varchar
province varchar
city varchar
}
Table orders {
id varchar [pk]
date_created timestamp
date_updated timestamp
customer varchar [ref: > customers.id]
status varchar
original_price decimal
total_price decimal
total_received decimal
email_sent boolean
}
Table order_items {
id varchar [pk]
order varchar [ref: > orders.id]
variant varchar [ref: > product_variants.id]
quantity int
price decimal
}
Table customers {
id varchar [pk]
email varchar
first_name varchar
last_name varchar
phone varchar
date_created timestamp
date_updated timestamp
}
Table order_transactions {
id varchar [pk]
date_created timestamp
date_updated timestamp
order varchar [ref: > orders.id]
amount decimal
status varchar
method varchar
details json
}