mirror of
https://github.com/qiurunze123/miaosha.git
synced 2023-11-19 22:41:03 +08:00
199 lines
510 KiB
MySQL
199 lines
510 KiB
MySQL
|
-- MySQL dump 10.13 Distrib 5.6.24, for Linux (x86_64)
|
|||
|
--
|
|||
|
-- Host: 127.0.0.1 Database: miaosha
|
|||
|
-- ------------------------------------------------------
|
|||
|
-- Server version 5.7.19-log
|
|||
|
|
|||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|||
|
/*!40101 SET NAMES utf8 */;
|
|||
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|||
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|||
|
|
|||
|
--
|
|||
|
-- Table structure for table `goods`
|
|||
|
--
|
|||
|
|
|||
|
DROP TABLE IF EXISTS `goods`;
|
|||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|||
|
/*!40101 SET character_set_client = utf8 */;
|
|||
|
CREATE TABLE `goods` (
|
|||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '商品ID',
|
|||
|
`goods_name` varchar(16) DEFAULT NULL COMMENT '商品名称',
|
|||
|
`goods_title` varchar(64) DEFAULT NULL COMMENT '商品标题',
|
|||
|
`goods_img` varchar(64) DEFAULT NULL COMMENT '商品的图片',
|
|||
|
`goods_detail` longtext COMMENT '商品的详情介绍',
|
|||
|
`goods_price` decimal(10,2) DEFAULT '0.00' COMMENT '商品单价',
|
|||
|
`goods_stock` int(11) DEFAULT '0' COMMENT '商品库存,-1表示没有限制',
|
|||
|
PRIMARY KEY (`id`)
|
|||
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
|||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|||
|
|
|||
|
--
|
|||
|
-- Dumping data for table `goods`
|
|||
|
--
|
|||
|
|
|||
|
LOCK TABLES `goods` WRITE;
|
|||
|
/*!40000 ALTER TABLE `goods` DISABLE KEYS */;
|
|||
|
INSERT INTO `goods` VALUES (1,'iphoneX','Apple iPhone X (A1865) 64GB 银色 移动联通电信4G手机','/img/iphonex.png','Apple iPhone X (A1865) 64GB 银色 移动联通电信4G手机',8765.00,10000),(2,'华为Meta9','华为 Mate 9 4GB+32GB版 月光银 移动联通电信4G手机 双卡双待','/img/meta10.png','华为 Mate 9 4GB+32GB版 月光银 移动联通电信4G手机 双卡双待',3212.00,-1),(3,'iphone8','Apple iPhone 8 (A1865) 64GB 银色 移动联通电信4G手机','/img/iphone8.png','Apple iPhone 8 (A1865) 64GB 银色 移动联通电信4G手机',5589.00,10000),(4,'小米6','小米6 4GB+32GB版 月光银 移动联通电信4G手机 双卡双待','/img/mi6.png','小米6 4GB+32GB版 月光银 移动联通电信4G手机 双卡双待',3212.00,10000);
|
|||
|
/*!40000 ALTER TABLE `goods` ENABLE KEYS */;
|
|||
|
UNLOCK TABLES;
|
|||
|
|
|||
|
--
|
|||
|
-- Table structure for table `miaosha_goods`
|
|||
|
--
|
|||
|
|
|||
|
DROP TABLE IF EXISTS `miaosha_goods`;
|
|||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|||
|
/*!40101 SET character_set_client = utf8 */;
|
|||
|
CREATE TABLE `miaosha_goods` (
|
|||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '秒杀的商品表',
|
|||
|
`goods_id` bigint(20) DEFAULT NULL COMMENT '商品Id',
|
|||
|
`miaosha_price` decimal(10,2) DEFAULT '0.00' COMMENT '秒杀价',
|
|||
|
`stock_count` int(11) DEFAULT NULL COMMENT '库存数量',
|
|||
|
`start_date` datetime DEFAULT NULL COMMENT '秒杀开始时间',
|
|||
|
`end_date` datetime DEFAULT NULL COMMENT '秒杀结束时间',
|
|||
|
PRIMARY KEY (`id`)
|
|||
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
|||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|||
|
|
|||
|
--
|
|||
|
-- Dumping data for table `miaosha_goods`
|
|||
|
--
|
|||
|
|
|||
|
LOCK TABLES `miaosha_goods` WRITE;
|
|||
|
/*!40000 ALTER TABLE `miaosha_goods` DISABLE KEYS */;
|
|||
|
INSERT INTO `miaosha_goods` VALUES (1,1,0.01,9,'2017-12-04 21:51:23','2017-12-31 21:51:27'),(2,2,0.01,9,'2017-12-04 21:40:14','2017-12-31 14:00:24'),(3,3,0.01,9,'2017-12-04 21:40:14','2017-12-31 14:00:24'),(4,4,0.01,9,'2017-12-04 21:40:14','2017-12-31 14:00:24');
|
|||
|
/*!40000 ALTER TABLE `miaosha_goods` ENABLE KEYS */;
|
|||
|
UNLOCK TABLES;
|
|||
|
|
|||
|
--
|
|||
|
-- Table structure for table `miaosha_order`
|
|||
|
--
|
|||
|
|
|||
|
DROP TABLE IF EXISTS `miaosha_order`;
|
|||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|||
|
/*!40101 SET character_set_client = utf8 */;
|
|||
|
CREATE TABLE `miaosha_order` (
|
|||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|||
|
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
|||
|
`order_id` bigint(20) DEFAULT NULL COMMENT '订单ID',
|
|||
|
`goods_id` bigint(20) DEFAULT NULL COMMENT '商品ID',
|
|||
|
PRIMARY KEY (`id`),
|
|||
|
UNIQUE KEY `u_uid_gid` (`user_id`,`goods_id`) USING BTREE
|
|||
|
) ENGINE=InnoDB AUTO_INCREMENT=1551 DEFAULT CHARSET=utf8mb4;
|
|||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|||
|
|
|||
|
--
|
|||
|
-- Dumping data for table `miaosha_order`
|
|||
|
--
|
|||
|
|
|||
|
LOCK TABLES `miaosha_order` WRITE;
|
|||
|
/*!40000 ALTER TABLE `miaosha_order` DISABLE KEYS */;
|
|||
|
INSERT INTO `miaosha_order` VALUES (1547,18912341234,1561,1),(1548,18912341234,1562,2),(1549,18912341234,1563,4),(1550,18912341234,1564,3);
|
|||
|
/*!40000 ALTER TABLE `miaosha_order` ENABLE KEYS */;
|
|||
|
UNLOCK TABLES;
|
|||
|
|
|||
|
--
|
|||
|
-- Table structure for table `miaosha_user`
|
|||
|
--
|
|||
|
|
|||
|
DROP TABLE IF EXISTS `miaosha_user`;
|
|||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|||
|
/*!40101 SET character_set_client = utf8 */;
|
|||
|
CREATE TABLE `miaosha_user` (
|
|||
|
`id` bigint(20) NOT NULL COMMENT '用户ID,手机号码',
|
|||
|
`nickname` varchar(255) NOT NULL,
|
|||
|
`password` varchar(32) DEFAULT NULL COMMENT 'MD5(MD5(pass明文+固定salt) + salt)',
|
|||
|
`salt` varchar(10) DEFAULT NULL,
|
|||
|
`head` varchar(128) DEFAULT NULL COMMENT '头像,云存储的ID',
|
|||
|
`register_date` datetime DEFAULT NULL COMMENT '注册时间',
|
|||
|
`last_login_date` datetime DEFAULT NULL COMMENT '上蔟登录时间',
|
|||
|
`login_count` int(11) DEFAULT '0' COMMENT '登录次数',
|
|||
|
PRIMARY KEY (`id`)
|
|||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|||
|
|
|||
|
--
|
|||
|
-- Dumping data for table `miaosha_user`
|
|||
|
--
|
|||
|
|
|||
|
LOCK TABLES `miaosha_user` WRITE;
|
|||
|
/*!40000 ALTER TABLE `miaosha_user` DISABLE KEYS */;
|
|||
|
INSERT INTO `miaosha_user` VALUES (13000000000,'user0','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000001,'user1','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000002,'user2','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000003,'user3','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000004,'user4','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000005,'user5','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000006,'user6','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000007,'user7','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000008,'user8','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000009,'user9','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000010,'user10','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000011,'user11','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000012,'user12','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000013,'user13','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000014,'user14','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000015,'user15','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000016,'user16','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000017,'user17','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000018,'user18','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000019,'user19','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000020,'user20','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000021,'user21','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000022,'user22','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000023,'user23','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000024,'user24','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000025,'user25','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000026,'user26','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000027,'user27','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000028,'user28','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000029,'user29','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000030,'user30','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000031,'user31','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000032,'user32','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000033,'user33','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000034,'user34','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000035,'user35','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000036,'user36','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000037,'user37','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000038,'user38','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000039,'user39','b7797cce01b4b131b433b6acf4add449','1a2b3c',NULL,'2017-11-30 09:01:59',NULL,1),(13000000040,'user40','b7797cce
|
|||
|
/*!40000 ALTER TABLE `miaosha_user` ENABLE KEYS */;
|
|||
|
UNLOCK TABLES;
|
|||
|
|
|||
|
--
|
|||
|
-- Table structure for table `order_info`
|
|||
|
--
|
|||
|
|
|||
|
DROP TABLE IF EXISTS `order_info`;
|
|||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|||
|
/*!40101 SET character_set_client = utf8 */;
|
|||
|
CREATE TABLE `order_info` (
|
|||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|||
|
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
|||
|
`goods_id` bigint(20) DEFAULT NULL COMMENT '商品ID',
|
|||
|
`delivery_addr_id` bigint(20) DEFAULT NULL COMMENT '收获地址ID',
|
|||
|
`goods_name` varchar(16) DEFAULT NULL COMMENT '冗余过来的商品名称',
|
|||
|
`goods_count` int(11) DEFAULT '0' COMMENT '商品数量',
|
|||
|
`goods_price` decimal(10,2) DEFAULT '0.00' COMMENT '商品单价',
|
|||
|
`order_channel` tinyint(4) DEFAULT '0' COMMENT '1pc,2android,3ios',
|
|||
|
`status` tinyint(4) DEFAULT '0' COMMENT '订单状态,0新建未支付,1已支付,2已发货,3已收货,4已退款,5已完成',
|
|||
|
`create_date` datetime DEFAULT NULL COMMENT '订单的创建时间',
|
|||
|
`pay_date` datetime DEFAULT NULL COMMENT '支付时间',
|
|||
|
PRIMARY KEY (`id`)
|
|||
|
) ENGINE=InnoDB AUTO_INCREMENT=1565 DEFAULT CHARSET=utf8mb4;
|
|||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|||
|
|
|||
|
--
|
|||
|
-- Dumping data for table `order_info`
|
|||
|
--
|
|||
|
|
|||
|
LOCK TABLES `order_info` WRITE;
|
|||
|
/*!40000 ALTER TABLE `order_info` DISABLE KEYS */;
|
|||
|
INSERT INTO `order_info` VALUES (1561,18912341234,1,NULL,'iphoneX',1,0.01,1,0,'2017-12-14 22:49:10',NULL),(1562,18912341234,2,NULL,'华为Meta9',1,0.01,1,0,'2017-12-14 22:55:42',NULL),(1563,18912341234,4,NULL,'小米6',1,0.01,1,0,'2017-12-16 16:19:23',NULL),(1564,18912341234,3,NULL,'iphone8',1,0.01,1,0,'2017-12-16 16:35:20',NULL);
|
|||
|
/*!40000 ALTER TABLE `order_info` ENABLE KEYS */;
|
|||
|
UNLOCK TABLES;
|
|||
|
|
|||
|
--
|
|||
|
-- Table structure for table `user`
|
|||
|
--
|
|||
|
|
|||
|
DROP TABLE IF EXISTS `user`;
|
|||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|||
|
/*!40101 SET character_set_client = utf8 */;
|
|||
|
CREATE TABLE `user` (
|
|||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|||
|
`name` varchar(10) DEFAULT NULL,
|
|||
|
PRIMARY KEY (`id`)
|
|||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
|
|||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|||
|
|
|||
|
--
|
|||
|
-- Dumping data for table `user`
|
|||
|
--
|
|||
|
|
|||
|
LOCK TABLES `user` WRITE;
|
|||
|
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
|
|||
|
INSERT INTO `user` VALUES (1,'Joshua');
|
|||
|
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
|
|||
|
UNLOCK TABLES;
|
|||
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|||
|
|
|||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|||
|
|
|||
|
-- Dump completed on 2017-12-28 22:24:35
|