database update ? and advice
Whats the best way to handle updates to my database when that database also contains client information. In hindsight having one db probably wasn't a good idea.
I need to modify the table structures, delete and add information but I don't want to loose any user information in the process.
I need a method that I can use repeatedly.
Any advice appreciated. :)
Re: database update ? and advice
It depends on the updates your doing.
Adding a column should be fine (and you can specify a default value for the column to cover records that already exist) as should adding new tables.
Deleting columns or tables will iinherently lose the data they contain unless you copy it sideways into some other structure first.
Re: database update ? and advice
Thanks FunckyDexter, when my client made changes the first time back in the summer of '06, I kinda did what you suggested only I didn't copy anything sideways. I was able to modify the db without loosing any client info and it worked fine.
I now have more changes, this will be the 2nd patch and keeping track of it all is getting complicated. I think I need to have a better method of keeping the user information separate from the application db.
Re: database update ? and advice
Perhaps you ought to separate them now, and work from there on?
Re: database update ? and advice
I generally wouldn't recommend keeping the data in two separate DB's - you'll just be complicating your life for little benefit. What are the sorts of changes your making that might be problematic?
Here we generally avoid removing columns or tables if we can possibly help it (even if they become redundant) as that's all that's likely to cause data loss. On those few occasions we have to remove something we simply make sure that we manage the change properly. It's really not that difficult but maybe you're hitting a scenario I haven't considered.
Re: database update ? and advice
Ah yes, I typed too fast. In a single database, but separate tables. Why the app data and user data are mingled is... strange?