sqldb/sqlc: prune_log schema

Define the schema for the prune log.
This commit is contained in:
Elle Mouton
2025-06-11 17:32:52 +02:00
parent 33e6f28542
commit 102c04daaf
3 changed files with 19 additions and 1 deletions

View File

@ -27,4 +27,5 @@ DROP TABLE IF EXISTS node_features;
DROP TABLE IF EXISTS node_extra_types;
DROP TABLE IF EXISTS nodes;
DROP TABLE IF EXISTS channel_policy_extra_types;
DROP TABLE IF EXISTS zombie_channels;
DROP TABLE IF EXISTS zombie_channels;
DROP TABLE IF EXISTS prune_log;

View File

@ -320,3 +320,15 @@ CREATE TABLE IF NOT EXISTS zombie_channels (
);
CREATE UNIQUE INDEX IF NOT EXISTS zombie_channels_channel_id_version_idx
ON zombie_channels(scid, version);
CREATE TABLE IF NOT EXISTS prune_log (
-- The block height that the prune was performed at.
-- NOTE: we don't use INTEGER PRIMARY KEY here since that would
-- get transformed into an auto-incrementing type by our SQL type
-- replacement logic. We don't want that since this must be the
-- actual block height and not an auto-incrementing value.
block_height BIGINT PRIMARY KEY,
-- The block hash that the prune was performed at.
block_hash BLOB NOT NULL
);

View File

@ -181,6 +181,11 @@ type NodeFeature struct {
FeatureBit int32
}
type PruneLog struct {
BlockHeight int64
BlockHash []byte
}
type SourceNode struct {
NodeID int64
}