Skip to content

Commit

Permalink
db: removed deprecated runes_uniqueid from vars table
Browse files Browse the repository at this point in the history
Fixes: #6696

Changelog-Fixed: rune: use runes table `id` instead `runes_uniqueid` from `vars` because it returns incorrect unique id if rune/s migrated from datastore.
  • Loading branch information
ShahanaFarooqui authored and rustyrussell committed Oct 2, 2023
1 parent c15fc54 commit 9561094
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_runes.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,3 +645,6 @@ def test_id_migration(node_factory):
'YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz',
'enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA='):
assert 'stored' not in only_one(l1.rpc.showrunes(rune)['runes'])

# Our migration should have removed this row now
assert l1.db_query("SELECT * FROM vars WHERE name = 'runes_uniqueid';") == []
1 change: 1 addition & 0 deletions wallet/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ static struct migration dbmigrations[] = {
{SQL("ALTER TABLE channel_funding_inflights ADD i_am_initiator INTEGER DEFAULT 0"), NULL},
{SQL("ALTER TABLE runes ADD last_used_nsec BIGINT DEFAULT NULL"), NULL},
{NULL, migrate_runes_idfix},
{SQL("DELETE FROM vars WHERE name = 'runes_uniqueid'"), NULL},
};

/**
Expand Down

0 comments on commit 9561094

Please sign in to comment.