diff --git a/sqldb/sqlc/migrations/000007_graph.down.sql b/sqldb/sqlc/migrations/000007_graph.down.sql index da92ccf22..b23ced950 100644 --- a/sqldb/sqlc/migrations/000007_graph.down.sql +++ b/sqldb/sqlc/migrations/000007_graph.down.sql @@ -9,6 +9,7 @@ DROP INDEX IF EXISTS graph_channels_node_id_1_idx; DROP INDEX IF EXISTS graph_channels_node_id_2_idx; DROP INDEX IF EXISTS graph_channels_unique; DROP INDEX IF EXISTS graph_channels_version_outpoint_idx; +DROP INDEX IF EXISTS graph_channels_version_id_idx; DROP INDEX IF EXISTS graph_channel_features_unique; DROP INDEX IF EXISTS graph_channel_extra_types_unique; DROP INDEX IF EXISTS graph_channel_policies_unique; diff --git a/sqldb/sqlc/migrations/000007_graph.up.sql b/sqldb/sqlc/migrations/000007_graph.up.sql index c1c69058c..1cb21be78 100644 --- a/sqldb/sqlc/migrations/000007_graph.up.sql +++ b/sqldb/sqlc/migrations/000007_graph.up.sql @@ -173,6 +173,7 @@ CREATE TABLE IF NOT EXISTS graph_channels ( -- indexes on the node_id_1 and node_id_2 columns. CREATE INDEX IF NOT EXISTS graph_channels_node_id_1_idx ON graph_channels(node_id_1); CREATE INDEX IF NOT EXISTS graph_channels_node_id_2_idx ON graph_channels(node_id_2); +CREATE INDEX IF NOT EXISTS graph_channels_version_id_idx ON graph_channels(version, id); -- A channel (identified by a short channel id) can only have one active -- channel announcement per protocol version. We also order the index by