-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrations #11
Comments
not directly related, just wanted to put it somewhere: |
I did some thoughts on migrations today. It's not 100% thought through, but maybe a good base for discussion. Migrating data in HoodieData needs to be migrated at two places
Migrating data locallyHoodie by design can be used without sync. Without an account, Because of that, it wouldn't be sufficient to migrate data in the databases on server only, as there are no databases for what we call "anonymous users". Migrating data locally would mean to pause any sync and then silently migrate all data locally. If the app is offline-first (e.g. with an appcache manifest), we need to prevent an inconsistency between the data and the app assets. Migrating data on the serverWhen migrating data on the server, hoodie server should
In some cases, multiple migrations need to be run at the same time. Namely I had the case that both the General notes on migrationsFrom my experience (I did 7 such migrations in a production app), in the most cases it's sufficient to migrate each object atomically. But in some cases, there is a dependency between the docs, and sometimes also on the Idea(s) for hoodie-plugin-migrationsThis is for the simplest (and most relevant) use case, when a migration means that all
Note that this approach requires the exclusive usage of the Every migration would set Ideas for hoodie-plugin-migrations admin UI
Thinking furtherI could well imagine that Hoodie will require migrations itself at some point, for major or minor version updates. I don't think it needs to be part of Hoodie core, but for apps that are using Hoodie today, we should provide a simple way to have existing data being migrated when required by a Hoodie version update. |
How should we handle the case when Hoodie-internal data structures change?
@gr2m should have discussion notes for this.
The text was updated successfully, but these errors were encountered: