lnbits-legend/lnbits/extensions/jukebox/migrations.py

40 lines
848 B
Python
Raw Normal View History

2021-04-27 10:07:17 +01:00
async def m001_initial(db):
"""
Initial jukebox table.
"""
await db.execute(
"""
CREATE TABLE jukebox (
2021-04-28 12:04:47 +01:00
id TEXT PRIMARY KEY,
2021-04-29 22:38:57 +01:00
user TEXT,
2021-04-28 12:04:47 +01:00
title TEXT,
wallet TEXT,
inkey TEXT,
2021-04-28 12:04:47 +01:00
sp_user TEXT NOT NULL,
sp_secret TEXT NOT NULL,
2021-04-29 00:40:58 +01:00
sp_access_token TEXT,
sp_refresh_token TEXT,
2021-04-28 12:04:47 +01:00
sp_device TEXT,
sp_playlists TEXT,
2021-05-03 23:22:40 +01:00
price INTEGER,
2021-06-07 23:29:40 +01:00
profit INTEGER
2021-04-27 10:07:17 +01:00
);
"""
2021-04-28 12:04:47 +01:00
)
2021-06-07 14:24:04 +01:00
async def m002_initial(db):
"""
Initial jukebox_payment table.
"""
await db.execute(
"""
CREATE TABLE jukebox_payment (
payment_hash TEXT PRIMARY KEY,
2021-06-07 14:24:04 +01:00
juke_id TEXT,
song_id TEXT,
paid BOOL
);
"""
2021-06-07 14:24:04 +01:00
)