I am very new to database design concepts. In my application we are using SQLite. Everything is working fine. Now because of the requirement changes we need to modify the database (need to remove some columns and add some other columns.)
When users upgrade our package we need to upgrade the old database to have latest columns and need to remove unwanted columns form database.
Our requirement is, user can upgrade form any lower version to any higher version. For this I have write the code like this. (I have written algo flow of the code).
1) Get the current DB version in the client machine. (one of the table column is having the DB version number.)
2) If version is same as current version of the package then don’t do any thing
3) If version is different then perform upgrade:
if (n.n.n.n == OLDDBVersion)
{
//Perform upgrade i.e. update the difference from version n to the current version
}
Please tell me the best practice to upgrade data base.