-
Notifications
You must be signed in to change notification settings - Fork 10
/
dbsetup.php
99 lines (58 loc) · 1.54 KB
/
dbsetup.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
<?php
if (!file_exists('silentc.db')) {
$db = new PDO('sqlite:silentc.db');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$db->setAttribute(PDO::ATTR_TIMEOUT, 15);
$db->query('
CREATE TABLE channel (
key INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
id INTEGER UNIQUE NOT NULL,
date INTEGER NOT NULL,
switch INTEGER DEFAULT 0,
adm TEXT NOT NULL,
timers TEXT NOT NULL,
fixed_timers TEXT NOT NULL,
block TEXT NOT NULL,
patterns TEXT NOT NULL,
last_editor INTEGER NULL,
last_edit_time INTEGER NULL,
is_channel TEXT null,
blocklist TEXT NOT NULL,
info TEXT NOT NULL,
whitelist TEXT NOT NULL,
mp_admins TEXT NOT NULL,
twig TEXT NULL
)
');
$db->query('
CREATE TABLE user (
key INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
id INTEGER UNIQUE NOT NULL,
date INTEGER NOT NULL,
waiting_param TEXT NULL,
waiting_for TEXT NULL,
waiting_back TEXT NULL,
language TEXT NOT NULL,
timezone TEXT NOT NULL
)
');
$db->query('
CREATE TABLE import (
key INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
id INTEGER NOT NULL,
date INTEGER NOT NULL,
adm INTEGER NULL,
imported INTEGER DEFAULT 0
)
');
$db->query('
CREATE TABLE twigs (
`key` integer primary key autoincrement not null,
info text not null,
post text not null,
twig text not null,
date integer not null
)
');
}