forked from kuustudio/novel-1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
novel.sql
359 lines (337 loc) · 14.3 KB
/
novel.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `xwx_admin`;
CREATE TABLE `xwx_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` char(32) NOT NULL,
`password` char(32) NOT NULL,
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`last_login_time` int(11) DEFAULT '0',
`last_login_ip` varchar(100) DEFAULT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for xwx_user
-- ----------------------------
DROP TABLE IF EXISTS `xwx_user`;
CREATE TABLE `xwx_user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` char(32) NOT NULL,
`nick_name` varchar(100) DEFAULT '',
`mobile` char(11) DEFAULT '' COMMENT '会员手机号',
`email` char(32) DEFAULT '' COMMENT '会员邮箱',
`password` char(32) NOT NULL,
`level` int default '0' COMMENT '为普通会员,1为vip会员',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`delete_time` int(11) DEFAULT '0',
`last_login_time` int(11) DEFAULT '0',
`vip_expire_time` int(11) DEFAULT '0' COMMENT '会员到期时间',
`pid`int(10) unsigned DEFAULT '0' COMMENT '上线用户ID',
`reg_ip` varchar(32) DEFAULT '' COMMENT '用户注册ip',
PRIMARY KEY (`id`) USING BTREE,
unique key `username` (`username`) ,
key `mobile` (`mobile`),
key `email` (`email`),
key `pid` (`pid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for xwx_user_finance
-- ----------------------------
DROP TABLE IF EXISTS `xwx_user_finance`;
CREATE TABLE `xwx_user_finance` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) NOT NULL DEFAULT 0,
`money` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '充值/消费金额',
`usage` tinyint(4) NOT NULL COMMENT '用途,1.充值,2.购买vip,3.购买章节,4.推广奖励, 5.绑定手机奖励',
`summary` text COMMENT '备注',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE,
key `user_id` (`user_id`) USING BTREE,
key `usage` (`usage`) USING BTREE
) ENGINE = InnoDB CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for xwx_user_order
-- ----------------------------
DROP TABLE IF EXISTS `xwx_user_order`;
CREATE TABLE `xwx_user_order` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) NOT NULL DEFAULT 0,
`money` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '充值金额',
`status` tinyint(4) not null default 0 COMMENT '0为未支付,1为已支付',
`pay_type` tinyint(4) default 1 COMMENT '0为未知,1为支付宝,2为QQ钱包,3为微信支付,4为卡密,5为PayPal',
`summary` text COMMENT '备注',
`order_id` varchar(100) default '' COMMENT '云端订单号',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`expire_time` int(11) default '0',
PRIMARY KEY (`id`) USING BTREE,
key `user_id` (`user_id`) USING BTREE,
key `status` (`status`) USING BTREE,
key `pay_type` (`pay_type`) USING BTREE
) ENGINE = InnoDB CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for xwx_user_buy
-- ----------------------------
DROP TABLE IF EXISTS `xwx_user_buy`;
CREATE TABLE `xwx_user_buy` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) NOT NULL DEFAULT 0 COMMENT '购买用户ID',
`chapter_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '购买漫画ID',
`book_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '购买章节ID',
`money` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '消费金额',
`summary` text COMMENT '备注',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for author
-- ----------------------------
DROP TABLE IF EXISTS `xwx_author`;
CREATE TABLE `xwx_author` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`author_name` varchar(100) NOT NULL,
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE,
key `author_name` (`author_name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for banner
-- ----------------------------
DROP TABLE IF EXISTS `xwx_banner`;
CREATE TABLE `xwx_banner` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pic_name` varchar(255) DEFAULT '' COMMENT '轮播图完整路径名',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`book_id` int(11) NOT NULL COMMENT '所属漫画ID',
`title` varchar(50) NOT NULL COMMENT '轮播图标题',
`banner_order` INT(11) DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
KEY `banner_order` (`banner_order`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for book
-- ----------------------------
DROP TABLE IF EXISTS `xwx_book`;
CREATE TABLE `xwx_book` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`unique_id` varchar(100) NOT NULL COMMENT '小说标识',
`book_name` varchar(50) NOT NULL COMMENT '小说名',
`nick_name` varchar(50) DEFAULT '' COMMENT '别名',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`last_time` int(11) DEFAULT '0' COMMENT '最后更新时间',
`delete_time` int(11) DEFAULT '0',
`tags` varchar(100) DEFAULT '' COMMENT '分类',
`summary` text COMMENT '简介',
`end` tinyint(4) DEFAULT '1' COMMENT '2为连载,1为完结',
`author_id` int(11) NOT NULL COMMENT '作者ID',
`author_name` varchar(24) DEFAULT '佚名',
`role_name` varchar(24) DEFAULT '未知',
`cover_url` varchar(255) DEFAULT '' COMMENT '封面图路径',
`start_pay` int(10) NOT NULL DEFAULT '99999' COMMENT '第m话开始需要付费',
`money` decimal(10,2) DEFAULT '0' COMMENT '每章所需费用',
`cate_id` int(11) NOT NULL COMMENT '所属题材',
`words` float(6,2) unsigned DEFAULT 0 COMMENT '字数',
PRIMARY KEY (`id`) USING BTREE,
KEY `tags` (`tags`) USING BTREE,
KEY `end` (`end`) USING BTREE,
KEY `author_id` (`author_id`) USING BTREE,
KEY `cate_id` (`cate_id`) USING BTREE,
KEY `words` (`words`) USING BTREE,
-- KEY `book_name` (`book_name`) USING BTREE
FULLTEXT KEY `book_name` (`book_name`) with parser ngram,
unique KEY `unique_id`(`unique_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for chapter
-- ----------------------------
DROP TABLE IF EXISTS `xwx_chapter`;
CREATE TABLE `xwx_chapter` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`chapter_name` varchar(255) NOT NULL COMMENT '章节名称',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`book_id` int(10) unsigned NOT NULL COMMENT '章节所属书ID',
`chapter_order` decimal(10,2) NOT NULL COMMENT '章节序',
`content_url` varchar(255) DEFAULT '' COMMENT '小说文件路径',
PRIMARY KEY (`id`) USING BTREE,
KEY `chapter_name` (`chapter_name`) USING BTREE,
KEY `book_id` (`book_id`) USING BTREE,
KEY `chapter_order` (`chapter_order`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `xwx_cate`;
CREATE TABLE `xwx_cate` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cate_name` varchar(20) NOT NULL COMMENT '分类名',
`gender` tinyint(4) DEFAULT 1 COMMENT '1男2女',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE,
unique KEY `cate_name` (`cate_name`),
KEY `gender` (`gender`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for tags
-- ----------------------------
DROP TABLE IF EXISTS `xwx_tags`;
CREATE TABLE `xwx_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tag_name` varchar(50) NOT NULL COMMENT '标签名',
`create_time` int(11) DEFAULT 0,
`update_time` int(11) DEFAULT 0,
`pinyin` varchar(255) NOT NULL COMMENT '拼音',
`jianpin` varchar(50) NOT NULL COMMENT '简拼',
PRIMARY KEY (`id`) USING BTREE,
FULLTEXT INDEX fidx (tag_name) WITH PARSER ngram,
KEY `pinyin`(`pinyin`) USING BTREE,
KEY `jianpin`(`jianpin`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for xwx_friendship_link
-- ----------------------------
DROP TABLE IF EXISTS `xwx_friendship_link`;
CREATE TABLE `xwx_friendship_link` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL COMMENT '友链名',
`url` varchar(255) NOT NULL COMMENT '友链地址',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Table structure for xwx_user_book
-- ----------------------------
DROP TABLE IF EXISTS `xwx_user_favor`;
CREATE TABLE `xwx_user_favor` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`book_id` int(10) unsigned NOT NULL COMMENT '用户收藏的小说ID',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
key book_id (`book_id`) USING BTREE,
key user_id (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for xwx_comments
-- ----------------------------
DROP TABLE IF EXISTS `xwx_comments`;
CREATE TABLE `xwx_comments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`book_id` int(10) unsigned NOT NULL DEFAULT '0',
`content` text,
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `book_id` (`book_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for xwx_message
-- ----------------------------
DROP TABLE IF EXISTS `xwx_message`;
CREATE TABLE `xwx_message` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT -1 COMMENT '父级留言id,也就是受回复留言id,没有则为-1',
`uid` int(11) DEFAULT -1 COMMENT '用户id,管理员为-1',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`content` text,
PRIMARY KEY (`id`) USING BTREE,
KEY `pid` (`pid`) USING BTREE,
KEY `uid` (`uid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for xwx_clicks
-- ----------------------------
DROP TABLE IF EXISTS `xwx_clicks`;
CREATE TABLE `xwx_clicks` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`book_id` int(10) UNSIGNED NOT NULL,
`clicks` int(10) UNSIGNED NOT NULL,
`cdate` datetime(0) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `book_id`(`book_id`) USING BTREE,
INDEX `cdate`(`cdate`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for xwx_vip_code
-- ----------------------------
DROP TABLE IF EXISTS `xwx_vip_code`;
CREATE TABLE `xwx_vip_code` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'vip码',
`add_day` int(11) DEFAULT 0 COMMENT '增加时间',
`create_time` int(11) DEFAULT 0,
`update_time` int(11) DEFAULT 0,
`used` tinyint(4) DEFAULT 1 COMMENT '1.未使用 2.已发出 3.已使用',
PRIMARY KEY (`id`) USING BTREE,
INDEX `code`(`code`) USING BTREE,
INDEX `used`(`used`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for xwx_charge_code
-- ----------------------------
DROP TABLE IF EXISTS `xwx_charge_code`;
CREATE TABLE `xwx_charge_code` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '卡密',
`money` decimal(5, 2) NOT NULL COMMENT '面额',
`used` tinyint(4) DEFAULT 1 COMMENT '1.未使用 2.已发出 3.已使用',
`create_time` int(11) NULL DEFAULT NULL,
`update_time` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `code`(`code`) USING BTREE,
INDEX `used`(`used`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for booklogs
-- ----------------------------
DROP TABLE IF EXISTS `xwx_book_logs`;
CREATE TABLE `xwx_book_logs` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`book_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
`book_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
`src_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`log_time` int(10) DEFAULT 0,
`src` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`last_chapter` varchar(100) DEFAULT NULL,
`last_chapter_order` int(10) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `src_url`(`src_url`) USING BTREE,
INDEX `book_id`(`book_id`) USING BTREE,
INDEX `book_name`(`book_name`) USING BTREE,
INDEX `log_time`(`log_time`) USING BTREE,
INDEX `src`(`src`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for chapterlogs
-- ----------------------------
DROP TABLE IF EXISTS `xwx_chapter_logs`;
CREATE TABLE `xwx_chapter_logs` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`chapter_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
`chapter_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
`src_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`chapter_order` int(10) UNSIGNED NOT NULL DEFAULT 0,
`log_time` int(10) UNSIGNED DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `src_url`(`src_url`) USING BTREE,
INDEX `chapter_id`(`chapter_id`) USING BTREE,
INDEX `chapter_name`(`chapter_name`) USING BTREE,
INDEX `chapter_order`(`chapter_order`) USING BTREE,
INDEX `log_time`(`log_time`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 ROW_FORMAT = Dynamic;
INSERT INTO xwx_admin(username, `password`) VALUES('admin','123456')