Skip to content

Add database versioning  #50

@Roasbeef

Description

@Roasbeef

Currently, there isn't an upgrade mechanism in place within the database which makes the current schema rigid and upgradeable. To remedy this, a new bucket should be added to the database (metaBucket) which stores key that house meta-data related to the current/version state of the database.

The createChannelDB method should be modified to create this new bucket+key during initializing. In a similar vein, when opening the database, the dbVersionKey should be read from the metaBucket and compared against some compile-time constant which stores the latest known database version. If the two versions differ (after some future database update/migration), logic should be inserted to convert the old format to the newly defined format. Additionally, it may be advisable to fist make a complete copy of the current database using bolt db's WriteToMethod as a fail-safe in case of bugs or failures during the database migration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    beginnerIssues suitable for new developersdatabaseRelated to the database/storage of LND

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions