-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrations.py
33 lines (31 loc) · 958 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
from lnbits.db import Connection
async def m001_initial(db: Connection):
await db.execute(
f"""
CREATE TABLE pay2print.printer (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
wallet TEXT NOT NULL,
name TEXT NOT NULL,
host TEXT NOT NULL,
amount INTEGER NOT NULL,
width INTEGER NOT NULL,
height INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
);
"""
)
await db.execute(
f"""
CREATE TABLE pay2print.print (
id TEXT PRIMARY KEY,
printer TEXT NOT NULL,
payment_hash TEXT NOT NULL,
payment_status TEXT NOT NULL,
print_status TEXT NOT NULL,
file TEXT NOT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now},
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
);
"""
)