-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.php
94 lines (80 loc) · 2.24 KB
/
install.php
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
<?php
require_once 'source/class/class_core.php';
$db = new DBConn($_config['dbhost']['ip'], $_config['dbhost']['user'], $_config['dbhost']['pwd'], $_config['dbhost']['base'],$_config['dbhost']['port']);
$sql = <<<EOF
CREATE TABLE IF NOT EXISTS `cdb_user` (
`username` char(32) NOT NULL,
`password` char(32) NOT NULL,
PRIMARY KEY (`username`)
);
CREATE TABLE IF NOT EXISTS `cdb_userinfo` (
`qq` bigint NOT NULL,
`nickname` varchar(255) DEFAULT NULL,
`sex` int DEFAULT 0,
`age` int DEFAULT 0,
`height` int DEFAULT 0,
`weight` int DEFAULT 0,
`arms` mediumtext DEFAULT NULL,
`introduce` mediumtext DEFAULT NULL,
`ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`utime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`qq`)
);
CREATE TABLE IF NOT EXISTS `cdb_userscore` (
`qq` bigint NOT NULL,
`score` int DEFAULT 0,
`credit` bigint DEFAULT 0,
`rank` int DEFAULT 0,
`scorerank` bigint DEFAULT 0,
PRIMARY KEY (`qq`),
KEY `scorerank` (`scorerank`) USING BTREE,
KEY `credit` (`credit`) USING BTREE
);
CREATE TABLE IF NOT EXISTS `cdb_userattr` (
`qq` bigint NOT NULL,
`str` int DEFAULT 0,
`dex` int DEFAULT 0,
`con` int DEFAULT 0,
`ine` int DEFAULT 0,
`wis` int DEFAULT 0,
`cha` int DEFAULT 0,
`free` int DEFAULT 0,
PRIMARY KEY (`qq`)
);
CREATE TABLE IF NOT EXISTS `cdb_userskill` (
`qq` bigint NOT NULL,
`skill1` mediumtext DEFAULT NULL,
`skill2` mediumtext DEFAULT NULL,
`skill3` mediumtext DEFAULT NULL,
`skill4` mediumtext DEFAULT NULL,
PRIMARY KEY (`qq`)
);
CREATE TABLE IF NOT EXISTS `cdb_checkin` (
`qq` bigint NOT NULL,
`count` int DEFAULT 0,
`countrank` bigint DEFAULT 0,
`lday` date NOT NULL,
PRIMARY KEY (`qq`),
KEY `lday` (`lday`) USING BTREE
);
CREATE TABLE IF NOT EXISTS `cdb_taskjoin` (
`day` date NOT NULL,
`maxmember` int DEFAULT NULL,
`begintime` varchar(255) DEFAULT NULL,
`member` mediumtext DEFAULT NULL,
PRIMARY KEY (`day`)
);
CREATE TABLE IF NOT EXISTS `cdb_userfight` (
`id` int auto_increment NOT NULL,
`qq` bigint DEFAULT NULL,
`pkqq` bigint DEFAULT NULL,
`isend` int DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `cdb_userbag` (
`qq` bigint NOT NULL,
`bag` mediumtext DEFAULT NULL,
PRIMARY KEY (`qq`)
);
EOF;
runquery($sql);