As an atproto service, we will face situations where we need all users to migrate their existing records to new collection/lexicon schema.
For example,
- #294 will merge two different
repo.*.commentcollections into onefeed.comment - There is ongoing discussion to use did for repositories, which might require all users to migrate their existing records.
To support this, it will be really convenient if we have a generalized user data migration UI.
Implementation#
Similar to DB migration but it opposite way, the appview will have atproto_need_migrations table holding user did & migration name. When we change lexicon NSID or schema in backwards incompatible way, we will list all authors of legacy records to the atproto_need_migrations table. So when listed user logs in, we will show them about the need of record migrations on banner. Which navigates to a dedicated page.
In most cases, we can just drop the legacy table as the data is atprotated. We can refetch them when the user migrate their legacy records.