Skip to content

Commit

Permalink
lnbits needs migrations in multiple steps
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Mar 12, 2024
1 parent 2551d77 commit 374270b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cashu/mint/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ async def m014_proofs_add_Y_column(db: Database):
# we have to drop the balance views first and recreate them later
await drop_balance_views(db, conn)

async with db.connect() as conn:
await conn.execute(
f"ALTER TABLE {table_with_schema(db, 'proofs_used')} ADD COLUMN Y TEXT"
)
Expand Down Expand Up @@ -481,6 +482,7 @@ async def m014_proofs_add_Y_column(db: Database):
)
await conn.execute(f"DROP TABLE {table_with_schema(db, 'proofs_used_old')}")

async with db.connect() as conn:
# add column Y to proofs_pending
await conn.execute(
f"ALTER TABLE {table_with_schema(db, 'proofs_pending')} ADD COLUMN Y TEXT"
Expand Down Expand Up @@ -527,6 +529,7 @@ async def m014_proofs_add_Y_column(db: Database):

await conn.execute(f"DROP TABLE {table_with_schema(db, 'proofs_pending_old')}")

async with db.connect() as conn:
# recreate the balance views
await create_balance_views(db, conn)

Expand Down

0 comments on commit 374270b

Please sign in to comment.