前提
前面建的User表只是为了测试redis与mysql,下面是项目数据库
库
商品表
秒杀商品表
订单表
秒杀订单表
秒杀用户表
/*Navicat MySQL Data TransferSource Server : box_net_testSource Server Version : 50568Source Host : mysql-test.agilenaas.net:3307Source Database : companyTarget Server Type : MYSQLTarget Server Version : 50568File Encoding : 65001Date: 2021-12-17 11:12:49*/SET FOREIGN_KEY_CHECKS=0;-- ------------------------------ Table structure for goods-- ----------------------------DROP TABLE IF EXISTS `goods`;CREATE TABLE `goods` (`id` bigint(11) NOT NULL AUTO_INCREMENT,`goods_name` varchar(255) DEFAULT NULL,`goods_title` varchar(255) DEFAULT NULL,`goods_img` varchar(255) DEFAULT NULL,`goods_detail` varchar(255) DEFAULT NULL,`goods_price` decimal(10,0) DEFAULT NULL,`goods_stock` int(11) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of goods-- ------------------------------ ------------------------------ Table structure for miaosha_goods-- ----------------------------DROP TABLE IF EXISTS `miaosha_goods`;CREATE TABLE `miaosha_goods` (`id` bigint(20) NOT NULL AUTO_INCREMENT,`goods_id` bigint(20) DEFAULT NULL,`stock_count` int(11) DEFAULT NULL,`start_date` datetime DEFAULT NULL,`end_date` datetime DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of miaosha_goods-- ------------------------------ ------------------------------ Table structure for miaosha_order-- ----------------------------DROP TABLE IF EXISTS `miaosha_order`;CREATE TABLE `miaosha_order` (`id` bigint(20) NOT NULL AUTO_INCREMENT,`user_id` bigint(20) DEFAULT NULL,`order_id` bigint(20) DEFAULT NULL,`goods_id` bigint(20) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of miaosha_order-- ------------------------------ ------------------------------ Table structure for miaosha_user-- ----------------------------DROP TABLE IF EXISTS `miaosha_user`;CREATE TABLE `miaosha_user` (`id` bigint(11) NOT NULL AUTO_INCREMENT,`nick_name` varchar(255) DEFAULT NULL,`password` varchar(255) DEFAULT NULL,`salt` varchar(255) DEFAULT NULL,`head` varchar(255) DEFAULT NULL,`register_date` datetime DEFAULT NULL,`last_login_date` datetime DEFAULT NULL,`login_count` varchar(255) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of miaosha_user-- ------------------------------ ------------------------------ Table structure for order_info-- ----------------------------DROP TABLE IF EXISTS `order_info`;CREATE TABLE `order_info` (`id` bigint(20) NOT NULL AUTO_INCREMENT,`user_id` bigint(20) DEFAULT NULL,`goods_id` bigint(20) DEFAULT NULL,`delivery_addr_id` bigint(20) DEFAULT NULL,`goods_name` varchar(255) DEFAULT NULL,`goods_count` int(11) DEFAULT NULL,`goods_price` decimal(10,0) DEFAULT NULL,`order_channel` int(11) DEFAULT NULL,`status` int(11) DEFAULT NULL,`create_date` datetime DEFAULT NULL,`pay_date` datetime DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of order_info-- ----------------------------
