-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdump.sql
More file actions
28 lines (24 loc) · 674 Bytes
/
dump.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;
CREATE TABLE orders(
id bigint primary key auto_increment,
item_id bigint not null,
status varchar(255) default 'pending',
created_at datetime,
updated_at datetime
);
CREATE TABLE stocks(
id bigint primary key auto_increment,
item_id bigint not null,
count int default 100,
created_at datetime,
updated_at datetime
);
CREATE TABLE deliveries(
id bigint primary key auto_increment,
order_id bigint not 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);