2009/3/17 Kris-I <[email protected]> > > Hello, > > Imagine, I do a software ... > > 1. At software installation (before or after), I need to create the > database and the schema. Wich strategy do you use to generate the > database ? OK, I generate the database from the mapping file. But to > do this, I have to do a small application to generate the database ? I > suppose I don't do that from the main application ... what is the best > strategy to do this ? Keep in mind, the end user is not working in the > IT world and I don't have access to his PC :) >
> > 2. Same question but for an update shema. In my application between > the version 1.0 and the version 1.1, I changed some field name, add > some field, add some table. Which strategy I have to use, to run my > application 1.1 on the DB 'version 1.1" and the the application 1.0 > with the DB "version 1.0" > > I need your feedback and experience about this. > So far I have used this strategy on multiple occasions: Create (probably write) a SQL script that transforms the database from one version to the next version. There are "database comparison tools" that can synchronize database schema. These might be useful during development but are generally useless when it comes to upgrades at customer sites, since they of course don't (automatically) handle cases where you need to transform data, perhaps because your model changes. Then, in a desktop application I was involved with the application contained a list of database versions and a bunch of transform scripts. On each start the app verified the database version and offered to upgrade if needed. A web application I'm currently involved with uses a similar approach, except the administrator must access a special page to access the db upgrade functionality. Take care if multiple users use the same database. Perhaps not everyone should be able to update the database? For initial deploy you could either create an empty database and run all upgrade scripts in order (script for initial version is nothing special), or you could include a prepared database in the latest version each time you do a new release. /Oskar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
