forked from Aivoapina/imneversorry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitdb.py
82 lines (62 loc) · 2.15 KB
/
initdb.py
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
import sqlite3 as sq
def initdb(db='bot.db'):
conn = sq.connect(db)
conn.execute("PRAGMA foreign_keys = ON")
conn.execute("PRAGMA encoding='UTF-8'")
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS Rip('
'rip text not null,'
'type text,'
'created date,'
'channel integer not null,'
'creator text,'
'primary key (rip, channel) )')
c.execute('CREATE TABLE IF NOT EXISTS Ripinfo('
'id integer primary key autoincrement,'
'rip text references Rip(rip) not null,'
'ripinfo text,'
'creator text)')
c.execute('CREATE TABLE IF NOT EXISTS Viisaus('
'viisaus text primary key)')
c.execute('CREATE TABLE IF NOT EXISTS Sana('
'sana text)')
c.execute('CREATE TABLE IF NOT EXISTS Oppi('
'keyword text not null,'
'definition text not null,'
'created date,'
'channel integer not null,'
'creator text,'
'primary key (keyword, channel))')
c.execute('CREATE TABLE IF NOT EXISTS Quote('
'quote text not null,'
'quotee text not null,'
'created date,'
'channel integer,'
'creator text,'
'primary key(quote, channel))')
c.execute('CREATE TABLE IF NOT EXISTS Diagnoosi('
'diagnoosi text)')
c.execute('CREATE TABLE IF NOT EXISTS Maito('
'maito text)')
c.execute('CREATE TABLE IF NOT EXISTS Nimi('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Kalat('
'kala text)')
c.execute('CREATE TABLE IF NOT EXISTS Vihannes('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Kulkuneuvo('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Planetoidi('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Linnut('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Arvonimet('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Sotilasnimet('
'nimi text)')
c.execute('CREATE TABLE IF NOT EXISTS Ennustus('
'rivi text)')
c.execute('CREATE TABLE IF NOT EXISTS Nakutukset('
'nakutus text)')
conn.commit()
conn.close()