-
Notifications
You must be signed in to change notification settings - Fork 89
/
mama-buy-stock.sql
65 lines (57 loc) · 2.61 KB
/
mama-buy-stock.sql
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
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50713
Source Host : localhost:3306
Source Database : mama-buy-stock
Target Server Type : MYSQL
Target Server Version : 50713
File Encoding : 65001
Date: 2018-12-29 14:23:23
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for t_stock
-- ----------------------------
DROP TABLE IF EXISTS `t_stock`;
CREATE TABLE `t_stock` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`sku_id` bigint(20) NOT NULL,
`stock` int(20) NOT NULL,
`lock_stock` tinyint(2) NOT NULL DEFAULT '0',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of t_stock
-- ----------------------------
INSERT INTO `t_stock` VALUES ('1', '1', '200', '0', '2018-12-22 09:59:35', '2018-12-22 09:59:38');
INSERT INTO `t_stock` VALUES ('2', '2', '310', '0', '2018-12-22 09:59:55', '2018-12-22 09:59:55');
INSERT INTO `t_stock` VALUES ('3', '3', '578', '0', '2018-12-22 10:00:07', '2018-12-22 10:00:07');
INSERT INTO `t_stock` VALUES ('4', '4', '235', '0', '2018-12-22 10:00:18', '2018-12-22 10:00:18');
INSERT INTO `t_stock` VALUES ('5', '5', '41', '0', '2018-12-22 10:00:31', '2018-12-22 10:00:31');
INSERT INTO `t_stock` VALUES ('6', '6', '143', '0', '2018-12-22 10:00:45', '2018-12-22 10:00:45');
-- ----------------------------
-- Table structure for t_stock_flow
-- ----------------------------
DROP TABLE IF EXISTS `t_stock_flow`;
CREATE TABLE `t_stock_flow` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`order_no` bigint(20) DEFAULT NULL,
`sku_id` bigint(20) DEFAULT NULL,
`stock_before` int(11) DEFAULT NULL,
`stock_after` int(11) DEFAULT NULL,
`stock_change` int(11) DEFAULT NULL,
`lock_stock_before` int(11) DEFAULT NULL,
`lock_stock_after` int(11) DEFAULT NULL,
`lock_stock_change` int(11) DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`check_status` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of t_stock_flow
-- ----------------------------
INSERT INTO `t_stock_flow` VALUES ('6', '6', '1', '200', '195', '-5', '0', '5', '5', '2018-12-22 21:34:50', '2018-12-22 21:34:50', null);