satmachineclient/migrations.py
2023-12-08 20:39:27 +00:00

31 lines
No EOL
736 B
Python

# The migration file is like a blockchain, never edit only add!
async def m001_initial(db):
"""
Initial templates table.
"""
await db.execute(
"""
CREATE TABLE temp.temp (
id TEXT PRIMARY KEY,
wallet TEXT NOT NULL,
name TEXT NOT NULL,
total INTEGER DEFAULT 0,
lnurlpayamount INTEGER DEFAULT 0,
lnurlwithdrawamount INTEGER DEFAULT 0,
);
"""
)
# Here we are adding an extra field to the database
async def m002_addtip_wallet(db):
"""
Add total to templates table
"""
await db.execute(
"""
ALTER TABLE temp.temp ADD lnurlwithdrawamount withdrawlimit INTEGER DEFAULT 0,;
"""
)