diff --git a/sqldb/sqlc/migrations/000007_graph.down.sql b/sqldb/sqlc/migrations/000007_graph.down.sql index a2f519a2c..396471196 100644 --- a/sqldb/sqlc/migrations/000007_graph.down.sql +++ b/sqldb/sqlc/migrations/000007_graph.down.sql @@ -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; \ No newline at end of file +DROP TABLE IF EXISTS zombie_channels; +DROP TABLE IF EXISTS prune_log; diff --git a/sqldb/sqlc/migrations/000007_graph.up.sql b/sqldb/sqlc/migrations/000007_graph.up.sql index a4303bf95..80a58cbd1 100644 --- a/sqldb/sqlc/migrations/000007_graph.up.sql +++ b/sqldb/sqlc/migrations/000007_graph.up.sql @@ -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 +); \ No newline at end of file diff --git a/sqldb/sqlc/models.go b/sqldb/sqlc/models.go index b750936d6..2bb61f769 100644 --- a/sqldb/sqlc/models.go +++ b/sqldb/sqlc/models.go @@ -181,6 +181,11 @@ type NodeFeature struct { FeatureBit int32 } +type PruneLog struct { + BlockHeight int64 + BlockHash []byte +} + type SourceNode struct { NodeID int64 }