db: removed deprecated runes_uniqueid from vars table

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.
This commit is contained in:
ShahanaFarooqui 2023-09-28 19:47:22 -07:00 committed by Rusty Russell
parent c15fc54586
commit 9561094433
2 changed files with 4 additions and 0 deletions

View File

@ -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';") == []

View File

@ -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},
};
/**