1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-09-11 14:31:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

商品模型-商品创建实现

This commit is contained in:
2022-03-03 15:31:44 +08:00
parent 65a5688804
commit 14f999e598
9 changed files with 399 additions and 4 deletions

View File

@@ -11,7 +11,7 @@
Target Server Version : 50726
File Encoding : 65001
Date: 03/03/2022 13:13:05
Date: 03/03/2022 15:29:13
*/
SET NAMES utf8mb4;
@@ -26,14 +26,15 @@ CREATE TABLE `item_info` (
`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,
`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 = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
) 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
@@ -46,11 +47,12 @@ CREATE TABLE `item_stock` (
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 = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
) 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