-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_db.py
executable file
·37 lines (30 loc) · 1.13 KB
/
create_db.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sqlite3
con = sqlite3.connect("enforsbot.db")
with con:
cur = con.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS LOCATION_HISTORY("
"USER TEXT,"
"LOCATION TEXT,"
"EVENT TEXT,"
"TIME TIMESTAMP);")
cur.execute("CREATE TABLE IF NOT EXISTS IRC_CHANNEL_LOG("
"USER TEXT,"
"TYPE TEXT,"
"CHANNEL TEXT,"
"MESSAGE TEXT,"
"TIME TIMESTAMP);")
cur.execute("CREATE TABLE IF NOT EXISTS USER("
"USER_ID INTEGER PRIMARY KEY AUTOINCREMENT,"
"NAME TEXT,"
"PASSWORD TEXT,"
"TWITTER_ID TEXT,"
"TELEGRAM_ID TEXT,"
"IRC_ID TEXT,"
"CREATED TIMESTAMP);")
cur.execute("CREATE TABLE IF NOT EXISTS USER_DATA("
"USER_ID INTEGER,"
"FIELD TEXT,"
"VAL TEXT,"
"LAST_UPDATE TIMESTAMP);")