db: set now-unused channels.short_channel_id text column to NULL after migration

Suggested-by: @cdecker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-09-19 10:24:26 +09:30 committed by Christian Decker
parent 939a7b2b18
commit e0218841c2

View file

@ -1508,6 +1508,11 @@ static void migrate_channels_scids_as_integers(struct lightningd *ld,
* (and sqlite3 has them referencing a now-deleted table!).
* When we can assume sqlite3 2021-04-19 (3.35.5), we can
* simply use DROP COLUMN (yay!) */
/* So null-out the unused column, at least! */
stmt = db_prepare_v2(db, SQL("UPDATE channels"
" SET short_channel_id = NULL;"));
db_exec_prepared_v2(take(stmt));
}
static void migrate_payments_scids_as_integers(struct lightningd *ld,