| 715 | } |
| 716 | |
| 717 | void migrate_initialize_invoice_wait_indexes(struct lightningd *ld, |
| 718 | struct db *db) |
| 719 | { |
| 720 | struct db_stmt *stmt; |
| 721 | bool res; |
| 722 | |
| 723 | /* "invoices.id" serves as the created_index. It's never 0. */ |
| 724 | stmt = db_prepare_v2(db, SQL("SELECT MAX(id) FROM invoices;")); |
| 725 | db_query_prepared(stmt); |
| 726 | res = db_step(stmt); |
| 727 | assert(res); |
| 728 | |
| 729 | if (!db_col_is_null(stmt, "MAX(id)")) |
| 730 | db_set_intvar(db, "last_invoice_created_index", |
| 731 | db_col_u64(stmt, "MAX(id)")); |
| 732 | tal_free(stmt); |
| 733 | } |
| 734 | |
| 735 | void migrate_invoice_created_index_var(struct lightningd *ld, struct db *db) |
| 736 | { |
nothing calls this directly
no test coverage detected