1 Star 1 Fork 0

a beautiful boy./HbutBookMarket

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
scavengers.sql 9.33 KB
一键复制 编辑 原始数据 按行查看 历史
liaoxinyin 提交于 2023-12-13 22:39 . init
-- MySQL dump 10.13 Distrib 8.0.28, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: book
-- ------------------------------------------------------
-- Server version 8.0.28
/*!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 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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 `cart`
--
DROP TABLE IF EXISTS `cart`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cart` (
`id` int NOT NULL,
`user_id` int DEFAULT NULL COMMENT '用户id',
`goods_id` int DEFAULT NULL COMMENT '商品id',
PRIMARY KEY (`id`),
KEY `cart_user_foreign_idx` (`user_id`),
KEY `cart_goods_foreign_idx` (`goods_id`),
CONSTRAINT `cart_goods_foreign` FOREIGN KEY (`goods_id`) REFERENCES `goods` (`id`),
CONSTRAINT `cart_user_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='购物车表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cart`
--
LOCK TABLES `cart` WRITE;
/*!40000 ALTER TABLE `cart` DISABLE KEYS */;
/*!40000 ALTER TABLE `cart` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `comments` (
`id` int NOT NULL,
`comments` varchar(255) DEFAULT NULL,
`create_time` varchar(255) DEFAULT NULL,
`goods_id` int DEFAULT NULL,
`user_id` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `comments`
--
LOCK TABLES `comments` WRITE;
/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `goods`
--
DROP TABLE IF EXISTS `goods`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `goods` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '商品主键',
`type_id` int DEFAULT NULL COMMENT '商品分类,外键',
`user_id` int NOT NULL COMMENT '用户外键',
`name` varchar(50) NOT NULL COMMENT '商品名称',
`price` float(11,2) NOT NULL COMMENT '出售价格',
`img_url` varchar(45) DEFAULT NULL,
`real_price` float(11,2) DEFAULT NULL COMMENT '真实价格',
`create_time` date DEFAULT NULL COMMENT '发布时间',
`polish_time` date DEFAULT NULL COMMENT '擦亮时间,按该时间进行查询,精确到时分秒',
`end_time` date DEFAULT NULL COMMENT '下架时间',
`description` text COMMENT '详细信息',
`status` int DEFAULT '1',
`comment_num` date DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `catelog_id` (`type_id`),
KEY `user_id` (`user_id`),
CONSTRAINT `goods_type_foreign` FOREIGN KEY (`type_id`) REFERENCES `type` (`id`),
CONSTRAINT `goods_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb3;
/*!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 (22,4,28,'Mysql从入门到入土',32.00,'f4ccf238-e458-4dda-9ed8-88bca2d42309.jpg',69.00,'2017-05-14','2017-05-14','2018-09-10','9.5成新书籍',0,NULL),(23,4,28,'计算机网络',40.00,'f4ccf238-e458-4dda-9ed8-88bca2d42309.jpg',69.00,'2017-05-14','2017-05-14','2018-09-10','9.5成新书籍',1,NULL),(32,4,1,'《形势与政策》',35.00,'f4ccf238-e458-4dda-9ed8-88bca2d42309.jpg',65.00,'2017-05-15','2017-05-15','2022-05-23','9.5成新书籍',1,NULL),(34,4,1,'高等数学-同济版',18.00,'f4ccf238-e458-4dda-9ed8-88bca2d42309.jpg',36.00,'2017-05-15','2017-05-15','2022-05-23','9.5成新书籍',1,NULL),(46,4,1,'Spring3.x--企业开发实战',95.00,'f4ccf238-e458-4dda-9ed8-88bca2d42309.jpg',112.00,'2017-05-15','2017-05-15','2022-05-23','9.5成新书籍',1,NULL),(47,4,1,'spring实战',60.00,'f4ccf238-e458-4dda-9ed8-88bca2d42309.jpg',80.00,'2017-05-16','2017-05-16','2022-05-23','9.5成新书籍',1,NULL);
/*!40000 ALTER TABLE `goods` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `hibernate_sequence`
--
DROP TABLE IF EXISTS `hibernate_sequence`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `hibernate_sequence` (
`next_val` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `hibernate_sequence`
--
LOCK TABLES `hibernate_sequence` WRITE;
/*!40000 ALTER TABLE `hibernate_sequence` DISABLE KEYS */;
INSERT INTO `hibernate_sequence` VALUES (22);
/*!40000 ALTER TABLE `hibernate_sequence` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `trade`
--
DROP TABLE IF EXISTS `trade`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `trade` (
`id` int NOT NULL,
`saler_id` int NOT NULL COMMENT '卖家id',
`buyer_id` int NOT NULL COMMENT '买家id',
`goods_id` int NOT NULL COMMENT '商品id',
`status` tinyint NOT NULL DEFAULT '2' COMMENT '交易状态\n1:未付款 2:未发货 3:正在路上 4:已确认收货 5:已评价',
`create_time` date DEFAULT NULL COMMENT '交易创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
KEY `deal_user_buyer_foreign_idx` (`buyer_id`),
KEY `deal_user_saler_foreign_idx` (`saler_id`),
KEY `deal_goods_foreign_idx` (`goods_id`),
CONSTRAINT `deal_goods_foreign` FOREIGN KEY (`goods_id`) REFERENCES `goods` (`id`),
CONSTRAINT `deal_user_buyer_foreign` FOREIGN KEY (`buyer_id`) REFERENCES `user` (`id`),
CONSTRAINT `deal_user_saler_foreign` FOREIGN KEY (`saler_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='货品交易';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `trade`
--
LOCK TABLES `trade` WRITE;
/*!40000 ALTER TABLE `trade` DISABLE KEYS */;
INSERT INTO `trade` VALUES (14,1,28,46,2,NULL),(21,1,28,47,2,NULL);
/*!40000 ALTER TABLE `trade` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `type`
--
DROP TABLE IF EXISTS `type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `type` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(30) DEFAULT NULL COMMENT '分类名',
`number` int DEFAULT '0' COMMENT '该分类下的商品数量',
`status` tinyint DEFAULT '0' COMMENT '分类状态,0正常,1暂用',
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `type`
--
LOCK TABLES `type` WRITE;
/*!40000 ALTER TABLE `type` DISABLE KEYS */;
INSERT INTO `type` VALUES (4,'图书教材',9,1);
/*!40000 ALTER TABLE `type` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT,
`phone` char(11) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录使用的手机号',
`username` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`password` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`QQ` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '即时通讯',
`create_time` date DEFAULT NULL COMMENT '创建时间',
`goods_num` int DEFAULT '0' COMMENT '发布过的物品数量',
`coin` float DEFAULT '0' COMMENT '账户金额',
`credit` float DEFAULT '5',
PRIMARY KEY (`id`),
UNIQUE KEY `username_UNIQUE` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1;
/*!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,'18794643154','ckq','ckq','1954879641','2017-05-10',11,7253,3.9375),(28,'13118899333','lxy','2110300324','2496922253',NULL,0,712,500);
/*!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 2023-12-13 21:20:08
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/a_beautiful_boy/HbutBookMarket.git
git@gitee.com:a_beautiful_boy/HbutBookMarket.git
a_beautiful_boy
HbutBookMarket
HbutBookMarket
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385