-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseed.py
67 lines (55 loc) · 1.45 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
59
60
61
62
63
64
65
66
67
import sqlite3
from flask import Blueprint
seed_db = Blueprint("seed", __name__)
@seed_db.cli.command("create-tables")
def create_tables():
connection = sqlite3.connect("webmentions.db")
with connection:
cursor = connection.cursor()
cursor.execute(
"""CREATE TABLE webmentions (
id integer primary key autoincrement,
source,
target,
property,
contents,
author_name,
author_photo,
author_url,
content_html,
received_date,
status,
vouch,
approved_to_show integer default 0);
"""
)
cursor.execute(
"""CREATE TABLE sent_webmentions (
id integer primary key autoincement,
source,
target,
sent_date,
status_code,
response,
webmention_endpoint);
"""
)
cursor.execute(
"""CREATE TABLE pending_webmentions (
id integer primary key autoincrement,
to_check);
"""
)
cursor.execute(
"""CREATE TABLE webhooks (
feed_url text,
last_url_sent text);
"""
)
cursor.execute(
"""CREATE TABLE vouch (
domain text,
added_date text);
"""
)
print("created database tables")