forked from chriy/HouseRentalSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhouse.sql
95 lines (84 loc) · 3.34 KB
/
house.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
Navicat MySQL Data Transfer
Source Server : y1ang
Source Server Version : 50723
Source Host : localhost:3306
Source Database : house
Target Server Type : MYSQL
Target Server Version : 50723
File Encoding : 65001
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `t_admin`
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`userpwd` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_admin
-- ----------------------------
-- ----------------------------
-- Table structure for `t_house`
-- ----------------------------
DROP TABLE IF EXISTS `t_house`;
CREATE TABLE `t_house` (
`h_id` int(11) NOT NULL AUTO_INCREMENT,
`house_desc` varchar(255) NOT NULL COMMENT '租房描述',
`house_model` varchar(20) NOT NULL COMMENT '房屋类型,几室几厅',
`house_area` varchar(20) NOT NULL COMMENT '房屋面积',
`house_floor` varchar(20) NOT NULL COMMENT '房屋楼层',
`house_type` varchar(20) NOT NULL COMMENT '出租方式',
`house_price` int(10) NOT NULL COMMENT '出租价格',
`house_address` varchar(100) NOT NULL COMMENT '出租地址',
`house_image` varchar(1000) NOT NULL COMMENT '房屋简介照片',
`community_name` varchar(100) NOT NULL COMMENT '小区名字',
`house_linkman` varchar(11) NOT NULL COMMENT '房屋联系电话',
`house_oriented` varchar(20) NOT NULL COMMENT '房屋朝向',
`house_detailes_img` varchar(1000) NOT NULL COMMENT '房屋详细页面展示图片',
`publisher` varchar(50) NOT NULL DEFAULT '管理员' COMMENT '发布人',
`publish_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '发布时间',
PRIMARY KEY (`h_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_house
-- ----------------------------
-- ----------------------------
-- Table structure for `t_order`
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order` (
`o_id` int(11) NOT NULL AUTO_INCREMENT,
`h_id` int(11) NOT NULL COMMENT '房屋租赁id',
`u_id` int(11) NOT NULL COMMENT '用户id',
`order_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`order_user` varchar(20) NOT NULL,
PRIMARY KEY (`o_id`),
KEY `fk1` (`h_id`),
KEY `fk2` (`u_id`),
CONSTRAINT `fk1` FOREIGN KEY (`h_id`) REFERENCES `t_house` (`h_id`),
CONSTRAINT `fk2` FOREIGN KEY (`u_id`) REFERENCES `t_users` (`u_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_order
-- ----------------------------
-- ----------------------------
-- Table structure for `t_users`
-- ----------------------------
DROP TABLE IF EXISTS `t_users`;
CREATE TABLE `t_users` (
`u_id` int(11) NOT NULL AUTO_INCREMENT,
`u_name` varchar(20) NOT NULL,
`u_password` varchar(100) NOT NULL,
`u_phone_number` varchar(11) DEFAULT NULL COMMENT '用户注册手机号码,用于找回密码',
`u_nickname` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '昵称',
PRIMARY KEY (`u_id`),
UNIQUE KEY `uniq` (`u_name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_users
-- ----------------------------