- Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdump.sql
More file actions
Latest commit
28 lines (24 loc) · 674 Bytes
/
Copy pathdump.sql
File metadata and controls
28 lines (24 loc) · 674 Bytes
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
USE order;
CREATETABLEorders(
id bigintprimary key auto_increment,
item_id bigintnot null,
status varchar(255) default 'pending',
created_at datetime,
updated_at datetime
);
CREATETABLEstocks(
id bigintprimary key auto_increment,
item_id bigintnot null,
count int default 100,
created_at datetime,
updated_at datetime
);
CREATETABLEdeliveries(
id bigintprimary key auto_increment,
order_id bigintnot null,
created_at datetime,
updated_at datetime
);
INSERT INTO stocks(item_id, count) VALUES(1, 100);
INSERT INTO stocks(item_id, count) VALUES(2, 100);
INSERT INTO stocks(item_id, count) VALUES(3, 100);