-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseed.py
58 lines (51 loc) · 1.13 KB
/
seed.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
import sqlite3
connection = sqlite3.connect("microsub.db")
with connection:
cursor = connection.cursor()
cursor.execute(
"""CREATE TABLE IF NOT EXISTS following(
channel text,
url text,
etag text,
photo text,
name text,
id integer primary key autoincrement,
muted integer,
blocked integer
)
"""
)
cursor.execute(
"""CREATE TABLE IF NOT EXISTS channels(
channel text,
uid text,
position text
)
"""
)
cursor.execute(
"""CREATE TABLE IF NOT EXISTS timeline(
channel text,
jf2 text,
date integer,
read_status text,
url text,
uid text,
hidden integer,
feed_id integer,
id integer primary key not null,
poll_cadence text
)
"""
)
cursor.execute(
"""CREATE TABLE IF NOT EXISTS websub_subscriptions(
url text,
uid text,
channel text,
approved integer
)
"""
)
print("microsub.db has been seeded.")
print("You are now ready to run the Microsub server.")