A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
I am curious to find out if anyone has any code available to handle updates on sql server? I am starting to release an application, and as I've been making changes where there are database level changes, I've been having to hit my client's database directly to make those changes. I would like to script this out so that the application handles it as part of the startup process.
Saturday, March 22, 2008
You need to keep track of what 'release' their db schema is and have a set of changes that can be applied to bring it up to date.
This requires re-thinking how you create your SQL, from a static model to a dynamic one. I'd recommend having a 'base' setup and then making all changes after that run through the update process.
If you store the changes based on release you will be able to bring any previous revision up to the current one by applying the changes serially.
Any project that is more than a one-off for personal use should implement something like this. There will be changes and dealing with them in a clean manner from the outset will make maintenance much easier.
I think that maybe I should have come out and blatently asked... did anyone have any sample source code on possible implementation strategies...
I have been throwing around several ideas including building an abstract class, with implemented classes having the schema update embedded, which could be run out of a controller process of some sort.
I had also thought about the case statements, but c# doesn't care for drop-through model like VB happens to handle quite well.
I'll have to ponder this over the next several days and come up with a decent version of the wheel.
Monday, March 24, 2008
Several ORMs such as Hibernate can update tables automatically, but they can't handle renames.
Sunday, April 13, 2008
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz