Skip to content

Commit 102c04d

Browse files
committed
sqldb/sqlc: prune_log schema
Define the schema for the prune log.
1 parent 33e6f28 commit 102c04d

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

sqldb/sqlc/migrations/000007_graph.down.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ DROP TABLE IF EXISTS node_features;
2727
DROP TABLE IF EXISTS node_extra_types;
2828
DROP TABLE IF EXISTS nodes;
2929
DROP TABLE IF EXISTS channel_policy_extra_types;
30-
DROP TABLE IF EXISTS zombie_channels;
30+
DROP TABLE IF EXISTS zombie_channels;
31+
DROP TABLE IF EXISTS prune_log;

sqldb/sqlc/migrations/000007_graph.up.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,15 @@ CREATE TABLE IF NOT EXISTS zombie_channels (
320320
);
321321
CREATE UNIQUE INDEX IF NOT EXISTS zombie_channels_channel_id_version_idx
322322
ON zombie_channels(scid, version);
323+
324+
CREATE TABLE IF NOT EXISTS prune_log (
325+
-- The block height that the prune was performed at.
326+
-- NOTE: we don't use INTEGER PRIMARY KEY here since that would
327+
-- get transformed into an auto-incrementing type by our SQL type
328+
-- replacement logic. We don't want that since this must be the
329+
-- actual block height and not an auto-incrementing value.
330+
block_height BIGINT PRIMARY KEY,
331+
332+
-- The block hash that the prune was performed at.
333+
block_hash BLOB NOT NULL
334+
);

sqldb/sqlc/models.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)