graph/db: migrate channels and polices to SQL

In this commit, the `MigrateGraphToSQL` function is expanded to migrate
the channel and channe policy data. Both of these have the special case
where the kvdb store records may contain invalid TLV. If we encounter a
channel with invalid TLV, we skip it and its policies. If we encounter a
policy with invalid TLV, we skip it.

The `TestMigrateGraphToSQL` and `TestMigrationWithChannelDB` tests are
updated accordingly.
This commit is contained in:
Elle Mouton committed 2025-07-09 10:18:57 +02:00
1 parent 61c1d258c3
commit b58089049a
3 files changed
+714 -5

No files matched your search

+3 -2
View File
@@ -4497,8 +4497,9 @@ func putChanEdgePolicy(edges kvdb.RwBucket, edge *models.ChannelEdgePolicy,
//
// TODO(halseth): get rid of these invalid policies in a
// migration.
// TODO(elle): complete the above TODO in migration from kvdb
// to SQL.
//
// NOTE: the above TODO was completed in the SQL migration and
// so such edge cases no longer need to be handled there.
oldEdgePolicy, err := deserializeChanEdgePolicy(
bytes.NewReader(edgeBytes),
)