前提


前面建的User表只是为了测试redis与mysql,下面是项目数据库


商品表
秒杀商品表
订单表
秒杀订单表
秒杀用户表

  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : box_net_test
  4. Source Server Version : 50568
  5. Source Host : mysql-test.agilenaas.net:3307
  6. Source Database : company
  7. Target Server Type : MYSQL
  8. Target Server Version : 50568
  9. File Encoding : 65001
  10. Date: 2021-12-17 11:12:49
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for goods
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `goods`;
  17. CREATE TABLE `goods` (
  18. `id` bigint(11) NOT NULL AUTO_INCREMENT,
  19. `goods_name` varchar(255) DEFAULT NULL,
  20. `goods_title` varchar(255) DEFAULT NULL,
  21. `goods_img` varchar(255) DEFAULT NULL,
  22. `goods_detail` varchar(255) DEFAULT NULL,
  23. `goods_price` decimal(10,0) DEFAULT NULL,
  24. `goods_stock` int(11) DEFAULT NULL,
  25. PRIMARY KEY (`id`)
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  27. -- ----------------------------
  28. -- Records of goods
  29. -- ----------------------------
  30. -- ----------------------------
  31. -- Table structure for miaosha_goods
  32. -- ----------------------------
  33. DROP TABLE IF EXISTS `miaosha_goods`;
  34. CREATE TABLE `miaosha_goods` (
  35. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  36. `goods_id` bigint(20) DEFAULT NULL,
  37. `stock_count` int(11) DEFAULT NULL,
  38. `start_date` datetime DEFAULT NULL,
  39. `end_date` datetime DEFAULT NULL,
  40. PRIMARY KEY (`id`)
  41. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  42. -- ----------------------------
  43. -- Records of miaosha_goods
  44. -- ----------------------------
  45. -- ----------------------------
  46. -- Table structure for miaosha_order
  47. -- ----------------------------
  48. DROP TABLE IF EXISTS `miaosha_order`;
  49. CREATE TABLE `miaosha_order` (
  50. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  51. `user_id` bigint(20) DEFAULT NULL,
  52. `order_id` bigint(20) DEFAULT NULL,
  53. `goods_id` bigint(20) DEFAULT NULL,
  54. PRIMARY KEY (`id`)
  55. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  56. -- ----------------------------
  57. -- Records of miaosha_order
  58. -- ----------------------------
  59. -- ----------------------------
  60. -- Table structure for miaosha_user
  61. -- ----------------------------
  62. DROP TABLE IF EXISTS `miaosha_user`;
  63. CREATE TABLE `miaosha_user` (
  64. `id` bigint(11) NOT NULL AUTO_INCREMENT,
  65. `nick_name` varchar(255) DEFAULT NULL,
  66. `password` varchar(255) DEFAULT NULL,
  67. `salt` varchar(255) DEFAULT NULL,
  68. `head` varchar(255) DEFAULT NULL,
  69. `register_date` datetime DEFAULT NULL,
  70. `last_login_date` datetime DEFAULT NULL,
  71. `login_count` varchar(255) DEFAULT NULL,
  72. PRIMARY KEY (`id`)
  73. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  74. -- ----------------------------
  75. -- Records of miaosha_user
  76. -- ----------------------------
  77. -- ----------------------------
  78. -- Table structure for order_info
  79. -- ----------------------------
  80. DROP TABLE IF EXISTS `order_info`;
  81. CREATE TABLE `order_info` (
  82. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  83. `user_id` bigint(20) DEFAULT NULL,
  84. `goods_id` bigint(20) DEFAULT NULL,
  85. `delivery_addr_id` bigint(20) DEFAULT NULL,
  86. `goods_name` varchar(255) DEFAULT NULL,
  87. `goods_count` int(11) DEFAULT NULL,
  88. `goods_price` decimal(10,0) DEFAULT NULL,
  89. `order_channel` int(11) DEFAULT NULL,
  90. `status` int(11) DEFAULT NULL,
  91. `create_date` datetime DEFAULT NULL,
  92. `pay_date` datetime DEFAULT NULL,
  93. PRIMARY KEY (`id`)
  94. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  95. -- ----------------------------
  96. -- Records of order_info
  97. -- ----------------------------