mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-23 19:54:18 +01:00
Mint: migration to clean up overly large witnesses (#817)
* add migration to clean up overly large witnesses * bump to 0.18.1
This commit is contained in:
@@ -1137,3 +1137,21 @@ async def m028_promises_c_allow_null_add_melt_quote(db: Database):
|
||||
|
||||
# recreate the balance views
|
||||
await create_balance_views(db, conn)
|
||||
|
||||
|
||||
async def m029_remove_overlong_witness_values(db: Database):
|
||||
"""
|
||||
Delete any witness values longer than 1024 characters in proofs tables.
|
||||
"""
|
||||
async with db.connect() as conn:
|
||||
# Clean proofs_used
|
||||
await conn.execute(
|
||||
f"UPDATE {db.table_with_schema('proofs_used')} SET witness = NULL "
|
||||
"WHERE witness IS NOT NULL AND LENGTH(witness) > 1024"
|
||||
)
|
||||
|
||||
# Clean proofs_pending (column exists in newer schemas)
|
||||
await conn.execute(
|
||||
f"UPDATE {db.table_with_schema('proofs_pending')} SET witness = NULL "
|
||||
"WHERE witness IS NOT NULL AND LENGTH(witness) > 1024"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user