mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
check for migration first (#750)
This commit is contained in:
@@ -289,6 +289,15 @@ async def m013_add_mint_and_melt_quote_tables(db: Database):
|
|||||||
|
|
||||||
async def m014_add_key_to_mint_quote_table(db: Database):
|
async def m014_add_key_to_mint_quote_table(db: Database):
|
||||||
async with db.connect() as conn:
|
async with db.connect() as conn:
|
||||||
|
# get column names in bolt11_mint_quotes first
|
||||||
|
columns = await conn.fetchall(
|
||||||
|
"""
|
||||||
|
SELECT name FROM pragma_table_info('bolt11_mint_quotes');
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
# check if privkey column already exists
|
||||||
|
if any(col["name"] == "privkey" for col in columns):
|
||||||
|
return
|
||||||
await conn.execute(
|
await conn.execute(
|
||||||
"""
|
"""
|
||||||
ALTER TABLE bolt11_mint_quotes
|
ALTER TABLE bolt11_mint_quotes
|
||||||
|
|||||||
Reference in New Issue
Block a user