• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making schema changes to an Application

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
G'Day all,

Thought I'd make a post to see what other people think of something I just started to think about.. I'm developing a swing based App, at the moment during development i'm switching between using mySql & hsqldb as my database for the app(Just because I find the gui's available for mysql easier to use, but the final version will be in hsqldb,maybe..)

Anyway I started to think about what happens in the future when hopefully I have a user base and make changes to my application which require changes to the database. Say for example I add a new column to one of my tables, well I suppose in the startup code I can check for the existance of that particular column and create it if it isnt there already. Which led me to think rather than ship a already existing database, why dont I have a routine at startup that checks for the existance of a database, and creates it and then checks for the existance of each table/column.

Is this a common approach ?

It would make my life eaiser in the sense each time I make a change to my database using mysql I also have to make the change to hsqldb, recopy the hsqldb to my directoy used by my installer generator blah blah when really if the change is made once in my startup procedure then it doesnt matter what db I'm using.

Rgds,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,
The idea seems sound, but it could get unmanagable quickly. Some schema changes are hard to make on the fly and you have to be able to upgrade between any two versions of the app that ever existed. Then again, any patching solution has to be able to do this too.

I think the key criteria are how many users have a copy of the database, whether or not they are internal and how frequently you expect change.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic