graph/db: migrate prune log

This commit expands the `MigrateGraphToSQL` to include migration of the
prune log.
This commit is contained in:
Elle Mouton committed 2025-07-11 09:15:47 +02:00
1 parent 63609b0801
commit 03ede9ccef
6 files changed
+252

No files matched your search

+13
View File
@@ -1350,6 +1350,19 @@ func (q *Queries) GetNodesByLastUpdateRange(ctx context.Context, arg GetNodesByL
return items, nil
}
const getPruneHashByHeight = `-- name: GetPruneHashByHeight :one
SELECT block_hash
FROM prune_log
WHERE block_height = $1
`
func (q *Queries) GetPruneHashByHeight(ctx context.Context, blockHeight int64) ([]byte, error) {
row := q.db.QueryRowContext(ctx, getPruneHashByHeight, blockHeight)
var block_hash []byte
err := row.Scan(&block_hash)
return block_hash, err
}
const getPruneTip = `-- name: GetPruneTip :one
SELECT block_height, block_hash
FROM prune_log