added OPER support (let the bots try to op themselves)
[NeonServV5.git] / database.sql
1 -- NeonServ Database v5.1
2
3 --
4 -- Tabellenstruktur für Tabelle `bans`
5 --
6
7 CREATE TABLE IF NOT EXISTS `bans` (
8   `ban_id` int(11) NOT NULL AUTO_INCREMENT,
9   `ban_channel` int(11) NOT NULL,
10   `ban_mask` varchar(250) NOT NULL,
11   `ban_triggered` int(15) NOT NULL,
12   `ban_timeout` int(15) NOT NULL,
13   `ban_owner` int(11) NOT NULL,
14   `ban_reason` varchar(512) NOT NULL,
15   PRIMARY KEY (`ban_id`)
16 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
17
18 -- --------------------------------------------------------
19
20 --
21 -- Tabellenstruktur für Tabelle `bots`
22 --
23
24 CREATE TABLE IF NOT EXISTS `bots` (
25   `id` int(11) NOT NULL AUTO_INCREMENT,
26   `active` tinyint(1) NOT NULL,
27   `nick` varchar(255) NOT NULL,
28   `server` varchar(255) NOT NULL,
29   `port` int(5) NOT NULL,
30   `pass` varchar(255) NOT NULL,
31   `ssl` tinyint(1) NOT NULL,
32   `bind` varchar(255) DEFAULT NULL,
33   `ident` varchar(12) NOT NULL,
34   `realname` varchar(255) NOT NULL,
35   `automodes` varchar(20) NOT NULL,
36   `oper_user` varchar(50) DEFAULT NULL,
37   `oper_pass` varchar(50) DEFAULT NULL,
38   `botclass` int(10) NOT NULL,
39   `textbot` tinyint(1) NOT NULL,
40   `queue` tinyint(1) NOT NULL,
41   `defaulttrigger` varchar(10) NOT NULL,
42   `max_channels` int(5) NOT NULL,
43   `register_priority` int(2) NOT NULL,
44   PRIMARY KEY (`id`),
45   UNIQUE KEY `nick` (`nick`)
46 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
47
48 -- --------------------------------------------------------
49
50 --
51 -- Tabellenstruktur für Tabelle `bot_binds`
52 --
53
54 CREATE TABLE IF NOT EXISTS `bot_binds` (
55   `id` int(11) NOT NULL AUTO_INCREMENT,
56   `botclass` int(11) NOT NULL,
57   `botid` int(11) NOT NULL,
58   `command` varchar(60) NOT NULL,
59   `function` varchar(60) NOT NULL,
60   `parameters` varchar(100) NOT NULL,
61   `chan_access` varchar(256) DEFAULT NULL,
62   `global_access` int(3) DEFAULT NULL,
63   `flags` int(10) NOT NULL,
64   PRIMARY KEY (`id`),
65   KEY `botid` (`botid`)
66 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
67
68 -- --------------------------------------------------------
69
70 --
71 -- Tabellenstruktur für Tabelle `bot_channels`
72 --
73
74 CREATE TABLE IF NOT EXISTS `bot_channels` (
75   `id` int(11) NOT NULL AUTO_INCREMENT,
76   `botid` int(11) NOT NULL,
77   `chanid` int(11) NOT NULL,
78   `trigger` varchar(50) NULL DEFAULT '+',
79   `suspended` tinyint(1) NOT NULL,
80   PRIMARY KEY (`id`)
81 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
82
83 -- --------------------------------------------------------
84
85 --
86 -- Tabellenstruktur für Tabelle `channels`
87 --
88
89 CREATE TABLE IF NOT EXISTS `channels` (
90   `channel_id` int(11) NOT NULL AUTO_INCREMENT,
91   `channel_name` varchar(250) NOT NULL,
92   `channel_key` varchar(50) NOT NULL,
93   `channel_maxusers` int(5) NOT NULL,
94   `channel_lastvisit` int(11) NOT NULL,
95   `channel_lastgiveowner` int(15) NOT NULL,
96   `channel_pubcmd` smallint(3) DEFAULT NULL,
97   `channel_nodelete` tinyint(1) NOT NULL,
98   `channel_nogaccess` tinyint(1) DEFAULT NULL,
99   `channel_canadd` smallint(3) DEFAULT NULL,
100   `channel_candel` smallint(3) DEFAULT NULL,
101   `channel_canclvl` smallint(3) DEFAULT NULL,
102   `channel_cankick` smallint(3) DEFAULT NULL,
103   `channel_canban` smallint(3) DEFAULT NULL,
104   `channel_staticban` smallint(3) DEFAULT NULL,
105   `channel_protect` tinyint(1) DEFAULT NULL,
106   `channel_canop` smallint(3) DEFAULT NULL,
107   `channel_canhalfop` smallint(3) DEFAULT NULL,
108   `channel_canvoice` smallint(3) DEFAULT NULL,
109   `channel_getop` smallint(3) DEFAULT NULL,
110   `channel_gethalfop` smallint(3) DEFAULT NULL,
111   `channel_getvoice` smallint(3) DEFAULT NULL,
112   `channel_greeting` varchar(512) NOT NULL,
113   `channel_usergreeting` varchar(512) NOT NULL,
114   `channel_userinfo` smallint(3) DEFAULT NULL,
115   `channel_dynlimit` smallint(5) DEFAULT NULL,
116   `channel_getinvite` smallint(3) DEFAULT NULL,
117   `channel_topicmask` varchar(512) NOT NULL,
118   `channel_exttopic` tinyint(1) NOT NULL,
119   `channel_exttopic_topic` varchar(512) NOT NULL,
120   `channel_defaulttopic` varchar(512) NOT NULL,
121   `channel_wipeinfo` smallint(3) DEFAULT NULL,
122   `channel_modes` varchar(500) DEFAULT NULL,
123   `channel_enfmodes` smallint(3) DEFAULT NULL,
124   `channel_enftopic` smallint(3) DEFAULT NULL,
125   `channel_topicsnarf` smallint(3) DEFAULT NULL,
126   `channel_changetopic` smallint(3) DEFAULT NULL,
127   `channel_setters` smallint(3) DEFAULT NULL,
128   `channel_canresync` smallint(3) DEFAULT NULL,
129   `channel_cansuspend` smallint(3) DEFAULT NULL,
130   `channel_notice` smallint(3) DEFAULT NULL,
131   `channel_noticereaction` tinyint(1) DEFAULT NULL,
132   `channel_ctcp` smallint(3) DEFAULT NULL,
133   `channel_ctcpreaction` tinyint(1) DEFAULT NULL,
134   `channel_registered` int(11) NOT NULL,
135   `channel_registrator` int(11) NOT NULL,
136   `channel_toys` tinyint(1) NOT NULL,
137   `channel_scanner` varchar(50) DEFAULT NULL,
138   `channel_spam_limit` smallint(3) DEFAULT NULL,
139   `channel_spam_reaction` tinyint(1) DEFAULT NULL,
140   `channel_spam_reaction_duration` mediumint(7) DEFAULT NULL,
141   `channel_spam_except` smallint(3) DEFAULT NULL,
142   `channel_flood_limit` smallint(3) DEFAULT NULL,
143   `channel_flood_time` smallint(3) DEFAULT NULL,
144   `channel_flood_reaction` tinyint(1) DEFAULT NULL,
145   `channel_flood_reaction_duration` mediumint(7) DEFAULT NULL,
146   `channel_flood_except` smallint(3) DEFAULT NULL,
147   `channel_join_limit` smallint(3) DEFAULT NULL,
148   `channel_join_time` smallint(3) DEFAULT NULL,
149   `channel_join_reaction` tinyint(1) DEFAULT NULL,
150   `channel_join_reaction_duration` mediumint(7) DEFAULT NULL,
151   `channel_join_except` smallint(3) DEFAULT NULL,
152   `channel_botnet_bantime` mediumint(7) DEFAULT NULL,
153   `channel_botnet_except` smallint(3) DEFAULT NULL,
154   `channel_caps_percent` tinyint(3) DEFAULT NULL,
155   `channel_caps_reaction` tinyint(1) DEFAULT NULL,
156   `channel_caps_reaction_duration` mediumint(7) DEFAULT NULL,
157   `channel_caps_except` smallint(3) DEFAULT NULL,
158   `channel_digit_percent` tinyint(3) DEFAULT NULL,
159   `channel_digit_reaction` tinyint(1) DEFAULT NULL,
160   `channel_digit_reaction_duration` mediumint(7) DEFAULT NULL,
161   `channel_digit_except` smallint(3) DEFAULT NULL,
162   `channel_badword_reaction` tinyint(1) DEFAULT NULL,
163   `channel_badword_reaction_duration` mediumint(7) DEFAULT NULL,
164   `channel_badword_except` smallint(3) DEFAULT NULL,
165   PRIMARY KEY (`channel_id`),
166   UNIQUE KEY `channel_name` (`channel_name`)
167 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
168
169 -- --------------------------------------------------------
170
171 --
172 -- Tabellenstruktur für Tabelle `chanusers`
173 --
174
175 CREATE TABLE IF NOT EXISTS `chanusers` (
176   `chanuser_id` int(11) NOT NULL AUTO_INCREMENT,
177   `chanuser_cid` int(11) NOT NULL,
178   `chanuser_uid` int(11) NOT NULL,
179   `chanuser_access` int(3) NOT NULL,
180   `chanuser_flags` int(11) NOT NULL,
181   `chanuser_seen` int(11) NOT NULL,
182   `chanuser_infoline` varchar(512) NOT NULL,
183   PRIMARY KEY (`chanuser_id`),
184   KEY `chanuser_cid` (`chanuser_cid`),
185   KEY `chanuser_uid` (`chanuser_uid`)
186 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
187
188 -- --------------------------------------------------------
189
190 --
191 -- Tabellenstruktur für Tabelle `events`
192 --
193
194 CREATE TABLE IF NOT EXISTS `events` (
195   `id` int(11) NOT NULL AUTO_INCREMENT,
196   `cid` int(11) NOT NULL,
197   `nick` varchar(50) NOT NULL,
198   `auth` varchar(50) NOT NULL,
199   `time` int(11) NOT NULL,
200   `command` varchar(512) NOT NULL,
201   PRIMARY KEY (`id`),
202   KEY `cid` (`cid`),
203   KEY `time` (`time`)
204 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
205
206 -- --------------------------------------------------------
207
208 --
209 -- Tabellenstruktur für Tabelle `funcmd`
210 --
211
212 CREATE TABLE IF NOT EXISTS `funcmd` (
213   `id` int(11) NOT NULL AUTO_INCREMENT,
214   `lang` int(11) NOT NULL,
215   `cmd` varchar(50) NOT NULL,
216   `text` text NOT NULL,
217   PRIMARY KEY (`id`)
218 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='neonserv v3';
219
220 -- --------------------------------------------------------
221
222 --
223 -- Tabellenstruktur für Tabelle `fundata`
224 --
225
226 CREATE TABLE IF NOT EXISTS `fundata` (
227   `id` int(11) NOT NULL AUTO_INCREMENT,
228   `cid` int(11) NOT NULL,
229   `user` varchar(50) NOT NULL,
230   `name` varchar(50) NOT NULL,
231   `value` text NOT NULL,
232   PRIMARY KEY (`id`),
233   KEY `cid` (`cid`),
234   KEY `user` (`user`),
235   KEY `name` (`name`)
236 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='neonserv v3' AUTO_INCREMENT=1 ;
237
238 -- --------------------------------------------------------
239
240 --
241 -- Tabellenstruktur für Tabelle `godlog`
242 --
243
244 CREATE TABLE IF NOT EXISTS `godlog` (
245   `godlog_id` int(11) NOT NULL AUTO_INCREMENT,
246   `godlog_uid` int(11) NOT NULL,
247   `godlog_cid` int(15) NOT NULL,
248   `godlog_time` int(15) NOT NULL,
249   `godlog_cmd` varchar(512) NOT NULL,
250   PRIMARY KEY (`godlog_id`)
251 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
252
253 -- --------------------------------------------------------
254
255 --
256 -- Tabellenstruktur für Tabelle `help`
257 --
258
259 CREATE TABLE IF NOT EXISTS `help` (
260   `id` int(11) NOT NULL AUTO_INCREMENT,
261   `lang` varchar(6) NOT NULL,
262   `ident` varchar(64) NOT NULL,
263   `text` text NOT NULL,
264   PRIMARY KEY (`id`)
265 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
266
267 -- --------------------------------------------------------
268
269 --
270 -- Tabellenstruktur für Tabelle `language`
271 --
272
273 CREATE TABLE IF NOT EXISTS `language` (
274   `id` int(11) NOT NULL AUTO_INCREMENT,
275   `lang` varchar(5) NOT NULL,
276   `ident` varchar(64) NOT NULL,
277   `text` varchar(256) NOT NULL,
278   PRIMARY KEY (`id`)
279 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
280
281 -- --------------------------------------------------------
282
283 --
284 -- Tabellenstruktur für Tabelle `noinvite`
285 --
286
287 CREATE TABLE IF NOT EXISTS `noinvite` (
288   `id` int(11) NOT NULL AUTO_INCREMENT,
289   `cid` int(11) NOT NULL,
290   `uid` int(11) NOT NULL,
291   PRIMARY KEY (`id`)
292 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
293
294 -- --------------------------------------------------------
295
296 --
297 -- Tabellenstruktur für Tabelle `owner_history`
298 --
299
300
301 CREATE TABLE IF NOT EXISTS `owner_history` (
302   `owner_history_id` int(11) NOT NULL AUTO_INCREMENT,
303   `owner_history_cid` int(11) NOT NULL,
304   `owner_history_to_uid` int(11) NOT NULL,
305   `owner_history_from_uid` int(11) NOT NULL,
306   `owner_history_time` int(11) NOT NULL,
307   PRIMARY KEY (`owner_history_id`),
308   KEY `owner_history_cid` (`owner_history_cid`)
309 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
310
311 -- --------------------------------------------------------
312
313 --
314 -- Tabellenstruktur für Tabelle `users`
315 --
316
317 CREATE TABLE IF NOT EXISTS `users` (
318   `user_id` int(11) NOT NULL AUTO_INCREMENT,
319   `user_user` varchar(250) NOT NULL,
320   `user_access` int(4) NOT NULL,
321   `user_rank` int(11) NOT NULL,
322   `user_god` tinyint(1) NOT NULL,
323   `user_lang` varchar(6) NOT NULL,
324   `user_reply_privmsg` tinyint(1) NOT NULL,
325   `user_registered` INT(20) NOT NULL,
326   `user_lastcheck` INT(20) NOT NULL,
327   PRIMARY KEY (`user_id`),
328   UNIQUE KEY `user_user` (`user_user`)
329 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
330
331 -- --------------------------------------------------------
332
333 --
334 -- Tabellenstruktur für Tabelle `support_ranks`
335 --
336
337 CREATE TABLE `support_ranks` (
338 `rank_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
339 `rank_name` VARCHAR( 256 ) NOT NULL ,
340 `rank_access` INT( 4 ) NOT NULL ,
341 `rank_info` VARCHAR( 512 ) NOT NULL ,
342 `rank_order` SMALLINT( 4 ) NOT NULL
343 ) ENGINE = MYISAM ;
344
345 -- --------------------------------------------------------
346
347 --
348 -- Tabellenstruktur für Tabelle `version`
349 --
350
351 CREATE TABLE IF NOT EXISTS `version` (
352   `database_version` int(5) NOT NULL,
353   PRIMARY KEY (`database_version`)
354 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
355
356 -- --------------------------------------------------------
357
358 --
359 -- Tabellenstruktur für Tabelle `donotregister`
360 --
361
362 CREATE TABLE `donotregister` (
363 `dnr_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
364 `dnr_target` VARCHAR( 256 ) NOT NULL ,
365 `dnr_user` INT( 11 ) NOT NULL ,
366 `dnr_timeout` INT( 20 ) NOT NULL ,
367 `dnr_reason` TEXT NOT NULL ,
368 UNIQUE (
369 `dnr_target`
370 )
371 ) ENGINE = MYISAM ;
372
373 -- --------------------------------------------------------
374
375 --
376 -- Tabellenstruktur für Tabelle `helpserv_requests`
377 --
378
379 CREATE TABLE IF NOT EXISTS `helpserv_requests` (
380   `id` int(11) NOT NULL AUTO_INCREMENT,
381   `botid` INT(11) NOT NULL,
382   `host` varchar(200) NOT NULL,
383   `hand` varchar(50) NOT NULL,
384   `nick` varchar(50) NOT NULL,
385   `status` int(1) NOT NULL,
386   `supporter` int(11) NOT NULL,
387   `time` int(20) NOT NULL,
388   `delay` int(20) NOT NULL,
389   `text` text NOT NULL,
390   `log` text NOT NULL,
391   PRIMARY KEY (`id`)
392 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
393
394 -- --------------------------------------------------------
395
396 --
397 -- Tabellenstruktur für Tabelle `helpserv_settings`
398 --
399
400 CREATE TABLE IF NOT EXISTS `helpserv_settings` (
401   `helpserv_botid` int(11) NOT NULL,
402   `helpserv_support` varchar(256) NOT NULL,
403   `helpserv_public` varchar(256) DEFAULT NULL,
404   `helpserv_intern` varchar(256) DEFAULT NULL,
405   `helpserv_intern_announce` TINYINT(1) NOT NULL,
406   PRIMARY KEY (`helpserv_botid`)
407 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
408
409 -- --------------------------------------------------------
410
411 --
412 -- Tabellenstruktur für Tabelle `settings`
413 --
414
415 CREATE TABLE IF NOT EXISTS `settings` (
416   `name` varchar(100) NOT NULL,
417   `value` text NOT NULL,
418   PRIMARY KEY (`name`)
419 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
420
421 -- --------------------------------------------------------
422
423 --
424 -- Tabellenstruktur für Tabelle `spamserv_badwords`
425 --
426
427 CREATE TABLE IF NOT EXISTS `spamserv_badwords` (
428   `badword_id` int(11) NOT NULL AUTO_INCREMENT,
429   `badword_cid` int(11) NOT NULL,
430   `badword_match` varchar(128) NOT NULL,
431   `badword_uid` int(11) NOT NULL,
432   `badword_use_default` tinyint(1) NOT NULL,
433   `badword_exceptlevel` smallint(3) NOT NULL,
434   `badword_scan_ops` tinyint(1) NOT NULL,
435   `badword_scan_voice` tinyint(1) NOT NULL,
436   `badword_use_default_reaction` tinyint(1) NOT NULL,
437   `badword_reaction` tinyint(1) NOT NULL,
438   `badword_reaction_time` int(20) NOT NULL,
439   PRIMARY KEY (`badword_id`),
440   KEY `badword_cid` (`badword_cid`)
441 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;