Co-Epi / app-backend-rust

iOS/Android shared Rust library for CoEpi
MIT License
40 stars 5 forks source link

DB migrations (reset) mechanism #124

Closed ivnsch closed 4 years ago

ivnsch commented 4 years ago

We should support versioning the database (similarly to how it's done with Realm in the apps), to at least reset it when the version is updated.

Current context: The TCNs table is getting new columns in 0.4, which will make the app crash for users updating from 0.3.

We can alternatively tell the testers to delete and reinstall the app, but this is not ideal.

duskoo commented 4 years ago

Apparently, SQLite migrations are built around

PRAGMA user_version;

statement, with custom logic attached. SO: Best Practices for in-app Database Migration

ivnsch commented 4 years ago

@duskoo iOS 0.4 should be done today, what's the status of this? I assume that most testers will be new (don't have an old version installed), but it would still be nice to have this.

duskoo commented 4 years ago

Hi @i-schuetz , plan is to finish the feature today.

duskoo commented 4 years ago

Implemented