views:

19

answers:

1

Hi, these are the rules for the game:

0) You have to use NHibernate;

1) You have a working database with data which must stay "alive" after the update;

2) If you have 3 versions of the database schema (1.0, 2.0 and 3.0) you should be able to update low->high version. (high->low is optional);

I know about the methods schema.Create()/Update() but I am not sure what is the best configuration for them. Also I want to know how you actually handle such situations.

Hala...

A: 

What you want is called "migration". There is no migration tool build in NHiberante. You have to use an external tools like tarentino, red get sql compare, etc.

Paco
Tarantino sounds good. Any tips that are beyond the tarantino's wiki are welcome
mynkow
You can use Tarantino combined with a script that generates migrations from the current NHibernate sessionfactory and the previous migrations. Click a .bat file to create a new migration. You can also integrate Tarantino with your build script, or use sql-command in the build scipt when the migrations are very simple. I don't use Tarantino in an advanced way, so I cannot give you a tip beyond the wiki. The redgate sql tools can be worth the money when you have to release very frequently.
Paco