-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrations.py
42 lines (38 loc) · 975 Bytes
/
migrations.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
from lnbits.db import Connection
async def m001_initial(db: Connection):
"""
Initial livestream tables.
"""
await db.execute(
"""
CREATE TABLE livestream.livestreams (
id TEXT PRIMARY KEY,
wallet TEXT NOT NULL,
fee_pct INTEGER NOT NULL DEFAULT 10,
current_track INTEGER
);
"""
)
await db.execute(
"""
CREATE TABLE livestream.producers (
id TEXT PRIMARY KEY,
livestream TEXT NOT NULL,
"user" TEXT NOT NULL,
wallet TEXT NOT NULL,
name TEXT NOT NULL
);
"""
)
await db.execute(
"""
CREATE TABLE livestream.tracks (
id TEXT PRIMARY KEY,
livestream TEXT NOT NULL,
download_url TEXT,
price_msat INTEGER NOT NULL DEFAULT 0,
name TEXT,
producer TEXT NOT NULL
);
"""
)