mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-01-11 12:18:22 +08:00
99 lines
4.1 KiB
SQL
99 lines
4.1 KiB
SQL
/*
|
||
Navicat Premium Data Transfer
|
||
|
||
Source Server : localhost MySQL 5.7
|
||
Source Server Type : MySQL
|
||
Source Server Version : 50726
|
||
Source Host : localhost:3306
|
||
Source Schema : flashsale
|
||
|
||
Target Server Type : MySQL
|
||
Target Server Version : 50726
|
||
File Encoding : 65001
|
||
|
||
Date: 03/03/2022 15:29:13
|
||
*/
|
||
|
||
SET NAMES utf8mb4;
|
||
SET FOREIGN_KEY_CHECKS = 0;
|
||
|
||
-- ----------------------------
|
||
-- Table structure for item_info
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `item_info`;
|
||
CREATE TABLE `item_info` (
|
||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||
`title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||
`price` decimal(10, 2) NOT NULL DEFAULT 0.00,
|
||
`description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||
`sales` int(11) NOT NULL DEFAULT 0,
|
||
`img_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||
PRIMARY KEY (`id`) USING BTREE
|
||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||
|
||
-- ----------------------------
|
||
-- Records of item_info
|
||
-- ----------------------------
|
||
INSERT INTO `item_info` VALUES (1, 'item-h7p0wt-22680', 22.00, '0sddhs4aeowc26638j5fp2ox', 0, 'https://domain.com/pic/190ghi.jpg');
|
||
|
||
-- ----------------------------
|
||
-- Table structure for item_stock
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `item_stock`;
|
||
CREATE TABLE `item_stock` (
|
||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||
`stock` int(11) NOT NULL,
|
||
`item_id` int(11) NOT NULL DEFAULT 0,
|
||
PRIMARY KEY (`id`) USING BTREE,
|
||
INDEX `item_id`(`item_id`) USING BTREE,
|
||
CONSTRAINT `item_stock_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `item_info` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
||
|
||
-- ----------------------------
|
||
-- Records of item_stock
|
||
-- ----------------------------
|
||
INSERT INTO `item_stock` VALUES (1, 140, 1);
|
||
|
||
-- ----------------------------
|
||
-- Table structure for user_info
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `user_info`;
|
||
CREATE TABLE `user_info` (
|
||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||
`gender` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1代表男性,2代表女性',
|
||
`age` int(11) NOT NULL DEFAULT 0,
|
||
`telephone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||
`register_mode` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '通过手机号注册,通过微信注册,通过支付宝注册',
|
||
`third_party_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||
PRIMARY KEY (`id`) USING BTREE,
|
||
UNIQUE INDEX `telephone_unique_index`(`telephone`) USING BTREE
|
||
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||
|
||
-- ----------------------------
|
||
-- Records of user_info
|
||
-- ----------------------------
|
||
INSERT INTO `user_info` VALUES (1, 'admin', 2, 18, '110', 'phone', '');
|
||
INSERT INTO `user_info` VALUES (2, 'user-1wk6xq-59489', 1, 49, '18900000001', 'phone', '');
|
||
|
||
-- ----------------------------
|
||
-- Table structure for user_password
|
||
-- ----------------------------
|
||
DROP TABLE IF EXISTS `user_password`;
|
||
CREATE TABLE `user_password` (
|
||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||
`encrypt_password` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||
`user_id` int(11) NOT NULL DEFAULT 0,
|
||
PRIMARY KEY (`id`) USING BTREE,
|
||
INDEX `user_id`(`user_id`) USING BTREE,
|
||
CONSTRAINT `user_password_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user_info` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
|
||
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||
|
||
-- ----------------------------
|
||
-- Records of user_password
|
||
-- ----------------------------
|
||
INSERT INTO `user_password` VALUES (1, '21232f297a57a5a743894a0e4a801fc3', 1);
|
||
INSERT INTO `user_password` VALUES (2, 'bnW2mQTNe40qWH3b5atFWw==', 2);
|
||
|
||
SET FOREIGN_KEY_CHECKS = 1;
|