Windows application setup - update and Database schema changes
I've one windows application which uses sqlite DB. I've created a setup for this application using setup and deployment project. I may 开发者_如何学JAVAhave to make builds every other month with changes in the application and user has to update it.
My application creates sqlite DB file when it runs for the first time. If DB file is there then it doesn't create it. Now, when I've an update for the application I'll have to make some changes in the DB schema as well. In this case user might have some data in the sqlite DB as well. I should not touch the data but update the DB schema. Also this will happen once in few months, as I'll be adding new features to the application.
How do we normally handle this kind of update for the application. I'm making new setup every time I add new features to the application, which will uninstall existing version and installs the new version. But I'm confused about the database part. How should we handle this incremental update in the DB schema?
Any suggestions?
Autopatchnet - This project is a .Net port of AutoPatch based on the original TactiKnowledge dotnet project.
ecm7migrator - This project is fork from Migrator.NET.
Migrator.NET - Database migrations for .NET. Based on the idea of Rails ActiveRecord Migrations.
You should have a DB version number in your database and get your app to update the database depending on the version number. So your sql update scripts will be contained in/called by your application, and be processed on startup.
The setup will update the code and files, and your application will update the database.
Although above answers will address my issue up to certain extent, I have come up with different approach altogether.
I've used database update approach given by DrDro. For the application update I think I have a better approach. I found one article which talks about automatic update of the application from the application itself whenever there is new update available at the source (In my case server).
Here is the article (This link is updated as earlier link was not working). It explains about this approach very clearly and it was bulls eye for my requirement.
精彩评论