-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable
More file actions
204 lines (179 loc) · 4.99 KB
/
table
File metadata and controls
204 lines (179 loc) · 4.99 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
Table users {
id INT [pk, increment]
username VARCHAR [not null, unique]
email VARCHAR [not null, unique]
password VARCHAR [not null]
phone VARCHAR
address VARCHAR
is_active BOOLEAN [default: true]
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
updated_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
}
Table permissions {
id INT [pk, increment]
name VARCHAR [not null, unique]
description TEXT
}
Table groups {
id INT [pk, increment]
name VARCHAR [not null, unique]
description TEXT
}
Table group_members {
user_id INT [ref: > users.id]
group_id INT [ref: > groups.id]
indexes {
(user_id, group_id) [unique]
}
}
Table group_permissions {
id INT [pk, increment]
group_id INT [ref: > groups.id]
permission_id INT [ref: > permissions.id]
target_id INT
is_active BOOLEAN [default: true]
is_denied BOOLEAN [default: false]
}
Table user_permissions {
id INT [pk, increment]
user_id INT [ref: > users.id]
permission_id INT [ref: > permissions.id]
target_id INT
is_active BOOLEAN [default: true]
is_denied BOOLEAN [default: false]
}
Table categories {
id INT [pk, increment]
name VARCHAR [not null, unique]
description TEXT
parent_id INT [ref: > categories.id]
}
Table products {
id INT [pk, increment]
name VARCHAR [not null]
description TEXT
location_address VARCHAR [not null]
category_id INT [ref: > categories.id]
popularity INT
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
updated_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
is_active BOOLEAN [default: true]
is_delete BOOLEAN [default: true]
}
Table product_attributes {
id INT [pk, increment]
product_id INT [ref: > products.id]
name VARCHAR(255) [not null]
}
Table product_attribute_values {
id INT [pk, increment]
attribute_id INT [ref: > product_attributes.id]
value VARCHAR(255) [not null]
}
Table product_options {
id INT [pk, increment]
product_id INT [ref: > products.id]
price DECIMAL(10,2) [not null]
stock INT [not null]
}
Table product_option_values {
id INT [pk, increment]
option_id INT [ref: > product_options.id]
attribute_value_id INT [ref: > product_attribute_values.id]
}
Table cart {
id INT [pk, increment]
user_id INT [ref: > users.id]
product_option_id INT [ref: > product_options.id]
quantity INT [default: 1]
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
}
Table wishlist {
id INT [pk, increment]
user_id INT [ref: >x users.id]
product_id INT [ref: > product_options.id]
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
}
Table coupons {
id INT [pk, increment]
code VARCHAR [not null, unique]
discount DECIMAL [not null]
start_date TIMESTAMP [not null]
end_date TIMESTAMP [not null]
is_active BOOLEAN [default: true]
}
Table orders {
id INT [pk, increment]
user_id INT [ref: > users.id]
total_amount DECIMAL [not null]
payment_method VARCHAR [not null]
shipping_status VARCHAR [not null]
payment_status VARCHAR [not null]
shipping_fee DECIMAL [default: 0.00]
discount DECIMAL [default: 0.00]
coupon_id INT [ref: > coupons.id]
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
updated_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
}
Table order_details {
id INT [pk, increment]
order_id INT [ref: > orders.id]
product_option_id INT [ref: > product_options.id]
quantity INT [not null]
price DECIMAL [not null]
}
Table reviews {
id INT [pk, increment]
product_id INT [ref: > products.id]
user_id INT [ref: > users.id]
rating INT [not null]
comment TEXT
is_approved BOOLEAN [default: false]
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
}
Table notifications {
id INT [pk, increment]
user_id INT [ref: > users.id]
title VARCHAR [not null]
message TEXT [not null]
type ENUM('email', 'sms', 'push') [default: 'push']
is_read BOOLEAN [default: false]
created_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
}
Table refresh_tokens {
id VARCHAR(64) [pk, not null]
expires_at TIMESTAMP [not null]
}
Table blacklist_tokens {
id VARCHAR(64) [pk, not null]
expires_at TIMESTAMP [not null]
}
Table list_tables {
table_name VARCHAR [pk]
description TEXT
}
Table files {
id INT [pk, increment]
user_id INT [ref: > users.id]
file_name VARCHAR [not null]
file_path VARCHAR [not null]
file_size INT [not null]
sort INT
uploaded_at TIMESTAMP [default: 'CURRENT_TIMESTAMP']
is_active BOOLEAN [default: true]
list_tables VARCHAR [ref: > list_tables.table_name]
description TEXT
}
Table interactions {
id INT [pk, increment]
user_id INT [ref: > users.id]
product_id INT [ref: > products.id]
action_id INT [ref: > actions.id]
created_at DATETIME [default: 'CURRENT_TIMESTAMP']
}
Table actions {
id INT [pk, increment]
name VARCHAR [not null, unique]
description TEXT
score INT [default: 0]
}