Skip to content
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

Recommended workflow for database migrations on live iOS app? #1771

Closed
garygcchiu opened this issue Apr 13, 2024 · 1 comment
Closed

Recommended workflow for database migrations on live iOS app? #1771

garygcchiu opened this issue Apr 13, 2024 · 1 comment

Comments

@garygcchiu
Copy link

garygcchiu commented Apr 13, 2024

I have an app using React Native, and WatermelonDB.

What is the recommended way to adding a new db migration? The docs mention refreshing my simulator/browser, but that doesn't make sense for live users since we are required to submit the binary to Apple -> await their review -> users install.

Is this the recommended workflow?

  1. Add new database migration
  2. Release (submit to App Store -> go through Apple review process)
  3. Make matching change in schema
  4. Release
  5. Bump schema version
  6. Release

The problem I see with this approach is there is no guarantee all users will incrementally use the latest version. If I have app:

  • Shipped version v1.1 with database version 1
  • Then ship v1.2 with database version 2 w/ a new migration added
  • Then ship v1.3 with matching schema for database version 2 added
  • Then bump schema version to 2

In the above scenario, if the user is on v1.1 and then downloads v1.3, wouldn't their database reset?

Or is it safe to just add db migration, make change to schema, bump schema version -> release all at once to App Store?

Is there a recommended approach for deploying out a database migration?

Thanks @radex @Nozbe

@primus11
Copy link

primus11 commented Apr 16, 2024

This browser refresh part is just for development purposes Why is this order important. What happens for end users is really on step 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants