-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_db.sql
199 lines (166 loc) · 4.31 KB
/
build_db.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
-- Creates a default database for the ocs5. the tables will be prefixed with ocs5_ by default.
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!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 */;
/*!40101 SET NAMES utf8 */;
CREATE TABLE `ocs5_chat` (
`id` int AUTO_INCREMENT,
`userID` int,
`chatroomID` int,
`msg` text CHARACTER SET utf8,
`time` bigint,
PRIMARY KEY (`id`)
);
CREATE TABLE `ocs5_chatroom` (
`id` int AUTO_INCREMENT,
`name` varchar(32) CHARACTER SET utf8,
`ownerID` int,
`minPower` int,
`password` varchar(128),
`salt` varchar(128),
`closed` int(1),
PRIMARY KEY (`id`)
);
INSERT INTO `ocs5_chatroom` (`id`, `name`, `ownerID`, `minPower`, `password`, `salt`, `closed`) VALUES
(1, 'main', -1, 0, '', '', 0),
(2, 'staff', -1, 40, '', '', 0);
CREATE TABLE `ocs5_command` (
`name` varchar(16),
`minPower` int,
PRIMARY KEY (`name`)
);
INSERT INTO `ocs5_command` (`name`, `minPower`) VALUES
('alert', 40),
('ban', 40),
('command', -1),
('config', 80),
('help', 0),
('kick', 40),
('log', 40),
('me', 0),
('mute', 40),
('nameColor', 0),
('permission', -1),
('profile', 0),
('saveAll', -1),
('setPower', -1),
('setRank', 40),
('sound', 40),
('status', 0),
('stop', -1),
('restart', -1),
('userpool', -1);
CREATE TABLE `ocs5_config` (
`name` varchar(32),
`value` int,
PRIMARY KEY (`name`)
);
INSERT INTO `ocs5_config` (`name`, `value`) VALUES
('loginMsgLimit', 50),
('logoutDelay', 20000),
('maxCreatedParties', 1),
('maxPartyNameLength', 255),
('maxPartyRounds', 100),
('maxScrambleCacheSize', 10),
('maxStatusLength', 255),
('maxUserPoolSize', 200),
('minChatMsgDelay', 1000),
('timeoutLimit', 120);
CREATE TABLE `ocs5_log_command` (
`id` int AUTO_INCREMENT,
`userID` int,
`time` bigint,
`command` varchar(32) CHARACTER SET utf8,
`arguments` varchar(128) CHARACTER SET utf8,
PRIMARY KEY (`id`)
);
CREATE TABLE `ocs5_log_login` (
`id` int AUTO_INCREMENT,
`userID` int,
`time` bigint,
`ip` varchar(64),
PRIMARY KEY (`id`)
);
CREATE TABLE `ocs5_party` (
`id` int AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8,
`ownerID` int,
`cubeType` varchar(32),
`ranking` varchar(8) CHARACTER SET utf8,
`rounds` int,
`startTime` bigint,
`mode` int(2),
PRIMARY KEY (`id`)
);
CREATE TABLE `ocs5_partyRound` (
`id` int AUTO_INCREMENT,
`partyID` int,
`round` int,
`scramble` text,
PRIMARY KEY (`id`)
);
CREATE TABLE `ocs5_partytime` (
`id` int AUTO_INCREMENT,
`partyID` int,
`userID` int,
`round` int,
`time` int,
PRIMARY KEY (`id`)
);
CREATE TABLE `ocs5_permission` (
`name` varchar(32),
`minPower` int(11),
PRIMARY KEY (`name`)
);
INSERT INTO `ocs5_permission` (`name`, `minPower`) VALUES
('createChatRoom', 20),
('createParty', 10),
('createPartyWithMode', 40),
('createUnlimitedParties', 20),
('debug', 100),
('editAllChatRooms', 40),
('editAllParties', 40),
('maxPower', 100),
('moderateUser', 40),
('seeAllRanks', 40),
('spamAllowed', 40);
CREATE TABLE `ocs5_rank` (
`power` int,
`name` varchar(8),
`show` int(1),
`short` varchar(3),
PRIMARY KEY (`power`)
);
INSERT INTO `ocs5_rank` (`power`, `name`, `show`, `short`) VALUES
(-1, 'banned', 1, 'B'),
(10, 'user', 0, 'U'),
(20, 'trusted', 0, 'U+'),
(40, 'mod', 1, 'M'),
(80, 'admin', 1, 'A'),
(100, 'dev', 1, 'Dev');
CREATE TABLE `ocs5_user` (
`id` int AUTO_INCREMENT,
`name` varchar(16) CHARACTER SET utf8,
`loginToken` varchar(32) DEFAULT '',
`password` varchar(120),
`power` int DEFAULT '10',
`status` varchar(255) CHARACTER SET utf8,
`nameColor` varchar(6) DEFAULT 'FFFFFF',
`registerDate` bigint(20),
`muteTime` bigint(20) DEFAULT '-1',
`banReason` varchar(128) CHARACTER SET utf8 DEFAULT '',
`onlineTime` bigint(20) DEFAULT '0',
`loginCount` int DEFAULT '0',
`chatMsgCount` int DEFAULT '0',
`wcaID` varchar(16) DEFAULT '',
`forumID` int DEFAULT '-1',
`registerToken` varchar(32),
`email` varchar(128) CHARACTER SET utf8,
`resetToken` varchar(32) DEFAULT '',
PRIMARY KEY (`id`)
) CHARSET=utf8 COLLATE=utf8_bin;
/*!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 */;