sqlite - Upgrade database and refactoring database schema -
this question has answer here:
i new database design concepts. in application using sqlite. working fine. because of requirement changes need modify database (need remove columns , add other columns.)
when users upgrade our package need upgrade old database have latest columns , need remove unwanted columns form database.
our requirement is, user can upgrade form lower version higher version. have write code this. (i have written algo flow of code).
1) current db version in client machine. (one of table column having db version number.)
2) if version same current version of package don’t thing
3) if version different perform upgrade:
if (n.n.n.n == olddbversion) { //perform upgrade i.e. update difference version n current version }
please tell me best practice upgrade data base.
why isn't database upgraded @ same time software upgraded? i'm assuming software upgraded because user says 'upgrade' or that, why don't upgrade db @ point? way avoid having software wrong db-version.
apart that, flow looks fine me.
Comments
Post a Comment