sqldb/sqlc: prune_log schema

Define the schema for the prune log.
This commit is contained in:
Elle Mouton committed 2025-06-25 10:48:35 +02:00
1 parent 33e6f28542
commit 102c04daaf
3 files changed
+19 -1

No files matched your search

+2 -1
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;
+12
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
);
+5
View File
@@ -181,6 +181,11 @@ type NodeFeature struct {
FeatureBit int32
}
type PruneLog struct {
BlockHeight int64
BlockHash []byte
}
type SourceNode struct {
NodeID int64
}