Skip to content

Commit

Permalink
db: Fix size mismatch on postgres in a migration
Browse files Browse the repository at this point in the history
Changelog-Fixed: db: Fixed a broken migration on postgres DBs that had really old channels.
  • Loading branch information
cdecker authored and rustyrussell committed Sep 23, 2020
1 parent a08e835 commit de7b416
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions wallet/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ static void fillin_missing_channel_id(struct lightningd *ld, struct db *db,
struct channel_id cid;
u32 outnum;

id = db_column_int(stmt, 0);
id = db_column_u64(stmt, 0);
db_column_txid(stmt, 1, &funding_txid);
outnum = db_column_int(stmt, 2);
derive_channel_id(&cid, &funding_txid, outnum);
Expand All @@ -1262,7 +1262,7 @@ static void fillin_missing_channel_id(struct lightningd *ld, struct db *db,
" SET full_channel_id = ?"
" WHERE id = ?;"));
db_bind_channel_id(update_stmt, 0, &cid);
db_bind_int(update_stmt, 1, id);
db_bind_u64(update_stmt, 1, id);

db_exec_prepared_v2(update_stmt);
tal_free(update_stmt);
Expand Down
2 changes: 1 addition & 1 deletion wallet/db_postgres_sqlgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wallet/db_sqlite3_sqlgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wallet/statements_gettextgen.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de7b416

Please sign in to comment.