-
Notifications
You must be signed in to change notification settings - Fork 0
/
kotlin_mall_create.sql
126 lines (114 loc) · 5.42 KB
/
kotlin_mall_create.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#数据库创建
CREATE DATABASE `DaDa` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
#用户表创建
use dada;
#用户表创建
CREATE TABLE `user_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '用户名(登录名)',
`user_pwd` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '登录密码',
`user_mobile` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '手机号\n',
`user_icon` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '头像\n',
`user_real_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '真实姓名\n',
`user_identity_card` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '身份证\n',
`user_nick_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '昵称\n',
`user_gender` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '性别',
`user_birthday` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '生日',
`user_address` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '居住地',
`user_sign` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '个性签名\n',
`push_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#购物车表创建
CREATE TABLE `cart_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goods_id` int(11) DEFAULT NULL,
`goods_desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_price` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_count` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`goods_sku` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#商品分类创建
CREATE TABLE `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`category_icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#商品信息表创建
CREATE TABLE `goods_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) DEFAULT NULL,
`goods_desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_default_icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_default_price` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_banner` text COLLATE utf8_unicode_ci,
`goods_detail_one` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_detail_two` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_sales_count` int(11) DEFAULT NULL,
`goods_stock_count` int(11) DEFAULT NULL,
`goods_code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_default_sku` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#商品sku表创建
CREATE TABLE `goods_sku` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goods_id` int(11) DEFAULT NULL,
`goods_sku_title` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_sku_content` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#消息表创建
CREATE TABLE `message_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`msg_icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`msg_title` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`msg_content` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`msg_time` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#订单商品表创建
CREATE TABLE `order_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goods_id` int(11) DEFAULT NULL,
`goods_desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_icon` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_price` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`goods_count` int(11) DEFAULT NULL,
`goods_sku` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`order_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#订单信息表创建
CREATE TABLE `order_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`pay_type` int(11) DEFAULT NULL,
`ship_id` int(11) DEFAULT NULL,
`total_price` int(11) DEFAULT NULL,
`order_status` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#地址管理表创建
CREATE TABLE `ship_address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ship_user_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`ship_user_mobile` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`ship_address` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`ship_is_default` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci