-
Notifications
You must be signed in to change notification settings - Fork 0
/
DB.xml
240 lines (237 loc) · 8.55 KB
/
DB.xml
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->
<!-- Active URL: https://ondras.zarovi.cz/sql/demo/ -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" quote=""/>
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
<type label="BIGINT" length="0" sql="BIGINT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
</group>
<group label="Character" color="rgb(255,200,200)">
<type label="Char" length="1" sql="CHAR" quote="'"/>
<type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
<type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
<type label="Binary" length="1" sql="BINARY" quote="'"/>
<type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
<type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
</group>
<group label="Date & Time" color="rgb(200,255,200)">
<type label="Date" length="0" sql="DATE" quote="'"/>
<type label="Time" length="0" sql="TIME" quote="'"/>
<type label="Datetime" length="0" sql="DATETIME" quote="'"/>
<type label="Year" length="0" sql="YEAR" quote=""/>
<type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
</group>
<group label="Miscellaneous" color="rgb(200,200,255)">
<type label="ENUM" length="1" sql="ENUM" quote=""/>
<type label="SET" length="1" sql="SET" quote=""/>
<type label="Bit" length="0" sql="bit" quote=""/>
</group>
</datatypes><table x="174" y="325" name="storage">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="product_id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
<relation table="product" row="id" />
</row>
<row name="product_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="delivery_timestamp" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table with info about storage (product, count, load timestamp)</comment>
</table>
<table x="963" y="565" name="store">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="width" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="height" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="length" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="carrying_capacity" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="shelf_number" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="product_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="product" row="id" />
</row>
<row name="product_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="last_charge" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table with info about store shelves (width, height, length, carrying capacity, shelf number, product ID, product count, last charge)</comment>
</table>
<table x="910" y="214" name="sales">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="product_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="product" row="id" />
</row>
<row name="sold_date" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<row name="sold_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="sold_price" null="0" autoincrement="0">
<datatype>FLOAT</datatype>
<default>0.0</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table with info about sales (product, date, sold count) </comment>
</table>
<table x="479" y="321" name="product">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="shelf_life" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<row name="width" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="height" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="length" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="weight" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="price" null="0" autoincrement="0">
<datatype>FLOAT</datatype>
<default>0.0</default></row>
<row name="stackable" null="0" autoincrement="0">
<datatype>TINYINT(1)</datatype>
<default>0</default></row>
<row name="name" null="0" autoincrement="0">
<datatype>VARCHAR(30)</datatype>
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table with info about products (shelf life, width, height, length, weight)</comment>
</table>
<table x="1168" y="422" name="stock">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="product_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="product" row="id" />
</row>
<row name="shelf_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="store" row="id" />
</row>
<row name="price" null="0" autoincrement="0">
<datatype>FLOAT</datatype>
<default>0.0</default></row>
<row name="start_timestamp" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<row name="end_timestamp" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table for promotional products (product ID, shelf ID (if needed), stock price, stock start timestamp, stock period)</comment>
</table>
<table x="241" y="622" name="failure">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="text" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="severity" null="0" autoincrement="0">
<datatype>INTEGER(1)</datatype>
<default>1</default></row>
<row name="timestamp" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table with info about failures (failure text, failure severity, failrute timestamp)</comment>
</table>
<table x="364" y="624" name="statistics">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="day" null="1" autoincrement="0">
<datatype>DATE</datatype>
<default>NULL</default></row>
<row name="revenue" null="0" autoincrement="0">
<datatype>DOUBLE</datatype>
<default>0.0</default></row>
<row name="sold_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<row name="is_stock_day" null="0" autoincrement="0">
<datatype>TINYINT(1)</datatype>
<default>0</default></row>
<row name="failures_count" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table for statistics about each day of supermarket work (day of work, revenue at this day, sold products count, is it a stock day, failures count)</comment>
</table>
<table x="125" y="623.6000061035156" name="user">
<row name="id" null="0" autoincrement="1">
<datatype>INTEGER</datatype>
</row>
<row name="login" null="0" autoincrement="0">
<datatype>VARCHAR(30)</datatype>
</row>
<row name="password" null="0" autoincrement="0">
<datatype>VARCHAR(100)</datatype>
</row>
<row name="email" null="1" autoincrement="0">
<datatype>VARCHAR(100)</datatype>
<default>NULL</default></row>
<row name="last_access" null="1" autoincrement="0">
<datatype>DATETIME</datatype>
<default>NULL</default></row>
<row name="group" null="0" autoincrement="0">
<datatype>ENUM</datatype>
<default>personel</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Table with info about each user (name, login, password, email (if defined), last access timestamp, group name)</comment>
</table>
</sql>