Add a new migration that updates the graph tables (nodes, channels and policies) in preparation for the new columns required for V2 announcements. This migration has to be added to the set of "live" migrations instead of "dev only" since it edits the columns of existing tables and so changes the existing sql models. We are going to prep the SQLStore code to handle the V2 types in the coming commits, so we need this migration to be in place. In this commit we also remove the TestSchemaMigrationIdempotency test since this test fails with the new "ALTER TABLE" migrations which dont have "IF NOT EXISTS" options like tables and indexes do. Migrations should be idempotent anyways due to the migration tracker file and/or the sqlc migration tracker.
23 lines
1.2 KiB
SQL
23 lines
1.2 KiB
SQL
-- The block height timestamp of this node's latest received node announcement.
|
|
-- It may be zero if we have not received a node announcement yet.
|
|
ALTER TABLE graph_nodes ADD COLUMN block_height BIGINT;
|
|
|
|
-- The signature of the channel announcement. If this is null, then the channel
|
|
-- belongs to the source node and the channel has not been announced yet.
|
|
ALTER TABLE graph_channels ADD COLUMN signature BLOB;
|
|
|
|
-- For v2 channels onwards, we cant necessarily derive the funding pk script
|
|
-- from the other fields in the announcement, so we store it here so that
|
|
-- we have easy access to it when we want to subscribe to channel closures.
|
|
ALTER TABLE graph_channels ADD COLUMN funding_pk_script BLOB;
|
|
|
|
-- The optional merkel root hash advertised in the V2 channel announcement.
|
|
ALTER TABLE graph_channels ADD COLUMN merkle_root_hash BLOB;
|
|
|
|
-- The block height timestamp of this channel's latest received channel-update
|
|
-- message (for v2 channel update messages).
|
|
ALTER TABLE graph_channel_policies ADD COLUMN block_height BIGINT;
|
|
|
|
-- A bitfield describing the disabled flags for a v2 channel update.
|
|
ALTER TABLE graph_channel_policies ADD COLUMN disable_flags SMALLINT
|
|
CHECK (disable_flags >= 0 AND disable_flags <= 255); |