Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pgsql.schema « scripts - github.com/isida/4.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 048183cf7eac238eb801477862a066c3227ca00d (plain)
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
-- --------------------------------------------------------------------------- --
--                                                                             --
--    Postgresql scheme for iSida Jabber Bot                                   --
--    Copyright (C) 2012 diSabler <dsy@dsy.name>                               --
--                                                                             --
--    This program is free software: you can redistribute it and/or modify     --
--    it under the terms of the GNU General Public License as published by     --
--    the Free Software Foundation, either version 3 of the License, or        --
--    (at your option) any later version.                                      --
--                                                                             --
--    This program is distributed in the hope that it will be useful,          --
--    but WITHOUT ANY WARRANTY; without even the implied warranty of           --
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            --
--    GNU General Public License for more details.                             --
--                                                                             --
--    You should have received a copy of the GNU General Public License        --
--    along with this program.  If not, see <http://www.gnu.org/licenses/>.    --
--                                                                             --
-- --------------------------------------------------------------------------- --

-- --------------------------------------------------------------------------- --
-- Base of ages
--
CREATE TABLE age (
	room text,
	nick text,
	jid text,
	time integer,
	age integer,
	status integer,
	type text,
	message text,
	no_case_nick text
);

CREATE INDEX age_rj ON age (room,jid);

CREATE INDEX age_rnj ON age (room,nick,jid);

CREATE TABLE jid (
	login text,
	server text,
	resourse text
);

CREATE INDEX jid_log ON jid (login);
CREATE INDEX jid_srv ON jid (server);
CREATE INDEX jid_res ON jid (resourse);

-- --------------------------------------------------------------------------- --
-- Base of talkers
--
CREATE TABLE talkers (
	room text,
	jid text,
	nick text,
	words integer,
	frases integer
);

CREATE INDEX talkers_rj ON talkers (room,jid);
CREATE INDEX talkers_rjn ON talkers (room,jid,nick);

-- --------------------------------------------------------------------------- --
-- Base for `WTF` commands
--
CREATE TABLE wtf (
	ind integer,
	room text,
	jid text,
	nick text,
	wtfword text,
	wtftext text,
	time integer,
	lim integer
);

CREATE INDEX wtf_r ON wtf (room);
CREATE INDEX wtf_rj ON wtf (room,jid);
CREATE INDEX wtf_rw ON wtf (room,wtfword);

-- --------------------------------------------------------------------------- --
-- Answers base for random flood
--
CREATE TABLE answer (
	ind integer,
	body text
);

-- INSERT INTO answer VALUES(1,';-)');
-- INSERT INTO answer VALUES(2,'Hi!');
CREATE INDEX answer_id ON answer (ind);

-- --------------------------------------------------------------------------- --
-- Base for `SayTo` plugin
--
CREATE TABLE sayto (
	who text,
	room text,
	jid text,
	message text
);

CREATE INDEX sayto_rj ON sayto (room,jid);

-- --------------------------------------------------------------------------- --
-- User distances for `Dist` plugin
--
CREATE TABLE dist (
	point text,
	latitude text,
	longtitude text
);

CREATE INDEX dist_di ON dist (point);

CREATE TABLE dist_user (
	point text,
	latitude text,
	longtitude text
);

CREATE INDEX dist_user_di ON dist_user (point);

-- --------------------------------------------------------------------------- --
-- Karma base
--
CREATE TABLE karma (
	room text,
	jid text,
	karma int
);

CREATE INDEX karma_krj ON karma (room,jid);
CREATE INDEX karma_crjk ON karma (room,jid,karma);

CREATE TABLE karma_commiters (
	room text,
	jid text,
	karmajid text,
	last int
);

CREATE INDEX karma_commiters_rjk ON karma_commiters (room,jid,karmajid);

CREATE TABLE karma_limits (
	room text,
	jid text,
	log text
);

CREATE INDEX karma_limits_lrj ON karma_limits (room,jid);

-- --------------------------------------------------------------------------- --
-- Action list base
--
CREATE TABLE acl (
	jid text,
	action text,
	type text,
	text text,
	command text,
	time int,
	level int default 9
);

CREATE INDEX acl_jid ON acl (jid,action,type);

-- --------------------------------------------------------------------------- --
-- Base for `GisMeteo` plugin
--
CREATE TABLE gis (
	code text,
	city text,
	lcity text
);

CREATE INDEX gis_clcc ON gis (code,lcity,city);

-- --------------------------------------------------------------------------- --
-- DEF-Codes
--
CREATE TABLE def_ru_stat (
	phone text,
	region text,
	city text
);

CREATE INDEX def_ru_stat_ph ON def_ru_stat (phone,city);

CREATE TABLE def_ua_stat (
	phone text,
	region text,
	city text
);

CREATE INDEX def_ua_stat_ph ON def_ua_stat (phone,city);

CREATE TABLE def_ru_mobile (
	provider text,
	region text,
	def integer,
	defbegin integer,
	defend integer,
	date text
);

CREATE INDEX def_ru_mobile_ph ON def_ru_mobile (def,defbegin,defend);

-- --------------------------------------------------------------------------- --
-- WZ Weather base
--
CREATE TABLE wz (
	code text,
	city text,
	counry text
);

CREATE INDEX wz_ccc ON wz (code,city,counry);

-- --------------------------------------------------------------------------- --
-- Muc-filter lock base
--
CREATE TABLE muc_lock (
	room text,
	jid text
);

CREATE INDEX muc_lock_rj ON muc_lock (room,jid);

-- --------------------------------------------------------------------------- --
-- Versions base
--
CREATE TABLE versions (
	room text,
	jid text,
	client text,
	version text,
	os text,
	time integer
);

DROP INDEX versions_rj;
DROP INDEX versions_cvo;
DROP INDEX versions_rjcvo;

CREATE INDEX versions_01 ON versions (client);
CREATE INDEX versions_02 ON versions (version);
CREATE INDEX versions_03 ON versions (os);
CREATE INDEX versions_04 ON versions (room,client);
CREATE INDEX versions_05 ON versions (room,version);
CREATE INDEX versions_06 ON versions (room,os);
CREATE INDEX versions_07 ON versions (room,client,version);
CREATE INDEX versions_08 ON versions (room,client,os);
CREATE INDEX versions_09 ON versions (room,os,version);
CREATE INDEX versions_10 ON versions (room,os,client);
CREATE INDEX versions_11 ON versions (room,version,os);
CREATE INDEX versions_12 ON versions (room,version,client);
CREATE INDEX versions_13 ON versions (room,jid);
CREATE INDEX versions_14 ON versions (client,version,os);
CREATE INDEX versions_15 ON versions (room,jid,client,version,os);
CREATE INDEX versions_16 ON versions (room,jid,os);
CREATE INDEX versions_17 ON versions (room,jid,version);
CREATE INDEX versions_18 ON versions (room,jid,client);
CREATE INDEX versions_19 ON versions (room,jid,version,os);
CREATE INDEX versions_20 ON versions (room,jid,client,os);
CREATE INDEX versions_21 ON versions (room,jid,client,version);
CREATE INDEX versions_22 ON versions (room,jid,version,client,os);
CREATE INDEX versions_23 ON versions (room,jid,version,os,client);
CREATE INDEX versions_24 ON versions (room,jid,os,client,version);
CREATE INDEX versions_25 ON versions (room,jid,os,version,client);
CREATE INDEX versions_26 ON versions (room,jid,client,os,version);
CREATE INDEX versions_27 ON versions (room,jid,client,version,os);
CREATE INDEX versions_28 ON versions (client,version);
CREATE INDEX versions_29 ON versions (version,os);
CREATE INDEX versions_30 ON versions (client,os);
CREATE INDEX versions_31 ON versions (jid,client,version);
CREATE INDEX versions_32 ON versions (jid,version,os);
CREATE INDEX versions_33 ON versions (jid,client,os);

-- --------------------------------------------------------------------------- --
-- Issues base
--
CREATE TABLE issues (
	id integer,
	room text,
	jid text,
	nick text,
	level integer,
	tags text,
	body text,
	status integer,
	date integer,
	comment text,
	accept_by text,
	accept_date integer
);

CREATE INDEX issues_r ON issues (room,id);
CREATE INDEX issues_d ON issues (room,date);

-- --------------------------------------------------------------------------- --
-- Cron base
--
CREATE TABLE cron (
	room text,
	jid text,
	nick text,
	time integer,
	repeat text,
	command text,
	level integer
);

CREATE INDEX cron_r ON cron (room);
CREATE INDEX cron_rt ON cron (room,time);
CREATE INDEX cron_rtr ON cron (room,time,repeat);

-- --------------------------------------------------------------------------- --
-- Conference config
--
CREATE TABLE config_conf (
	room text,
	option text,
	value text
);

CREATE INDEX config_conf_r ON config_conf (room);
CREATE INDEX config_conf_ro ON config_conf (room,option);

-- --------------------------------------------------------------------------- --
-- Owner config
--
CREATE TABLE config_owner (
	option text unique,
	value text
);

CREATE INDEX config_owner_o ON config_owner (option);

-- --------------------------------------------------------------------------- --
-- Top command
--
CREATE TABLE top (
	room text unique,
	count integer,
	time integer
);

CREATE INDEX top_r ON top (room);
CREATE INDEX top_rc ON top (room,count);

-- --------------------------------------------------------------------------- --
-- Aliases
--
CREATE TABLE alias (
	room text,
	match text,
	cmd text
);

CREATE INDEX alias_r ON alias (room);
CREATE INDEX alias_rm ON alias (room,match);

-- --------------------------------------------------------------------------- --
-- Blacklist for rooms
--
CREATE TABLE blacklist (
	room text unique
);

-- --------------------------------------------------------------------------- --
-- Comm ON/OFF
--
CREATE TABLE commonoff (
	room text,
	cmd text
);

CREATE INDEX commonoff_r ON commonoff (room);
CREATE INDEX commonoff_rm ON commonoff (room,cmd);

-- --------------------------------------------------------------------------- --
-- Rooms list
--
CREATE TABLE conference (
	room text unique,
	passwd text
);

-- --------------------------------------------------------------------------- --
-- Feeds
--
CREATE TABLE feed (
	url text,
	update text,
	type text,
	time integer,
	room text,
	hash text array[10],
	changed text
);

CREATE INDEX feed_r ON feed (room);
CREATE INDEX feed_rt ON feed (room,time);

-- --------------------------------------------------------------------------- --
-- Hiden rooms
--
CREATE TABLE hiden_rooms (
	room text unique
);

-- --------------------------------------------------------------------------- --
-- Bot Ignore
--
CREATE TABLE bot_ignore (
	pattern text unique
);

CREATE INDEX bot_ignore_p ON bot_ignore (pattern);

-- --------------------------------------------------------------------------- --
-- Bot Owner
--
CREATE TABLE bot_owner (
	jid text unique
);

CREATE INDEX bot_owner_j ON bot_owner (jid);

-- --------------------------------------------------------------------------- --
-- Logs in rooms
--
CREATE TABLE log_rooms (
	room text unique
);

CREATE INDEX log_rooms_r ON log_rooms (room);

-- --------------------------------------------------------------------------- --
-- Spy for activity
--
CREATE TABLE spy (
	room text unique,
	time integer,
	participant integer,
	message integer,
	pattern text
);

CREATE INDEX spy_r ON spy (room);
CREATE INDEX spy_rt ON spy (room,time);

-- --------------------------------------------------------------------------- --
-- Temporary ban
--
CREATE TABLE tmp_ban (
	room text,
	jid text,
	time integer
);

CREATE INDEX tmp_ban_r ON tmp_ban (room);
CREATE INDEX tmp_ban_rt ON tmp_ban (room,time);

-- --------------------------------------------------------------------------- --
-- Say to owner
--
CREATE TABLE saytoowner (
	jid text unique,
	time integer
);

-- --------------------------------------------------------------------------- --
-- Ignore ban for global_ban
--
CREATE TABLE ignore_ban (
	room text unique
);

-- --------------------------------------------------------------------------- --
-- First join time
--
CREATE TABLE first_join (
	room text,
	jid text,
	time integer
);

CREATE INDEX join_rj ON first_join (room,jid);

-- --------------------------------------------------------------------------- --
-- URL Storage
--
CREATE TABLE url (
	room text,
	jid text,
	nick text,
	time integer,
	url text,
	title text);

CREATE INDEX url_r ON url (room);
CREATE INDEX url_rj ON url (room,jid);
CREATE INDEX url_rjn ON url (room,jid,nick);
CREATE INDEX url_rt ON url (room,time);

-- --------------------------------------------------------------------------- --
-- THE END
-- --------------------------------------------------------------------------- --