Question

I'm using NHibernate 2 and PostgreSQL in my project. SchemaExport class does a great job generating DDL scheme for database, but it's great until the first application.

Is there any way to generate "migration" DLL (batch of "ALTER TABLE"'s instead of DROP/CREATE pair) using NHibernate mapping files?

Was it helpful?

Solution

Look into SchemaUpdate. Very similiar API as SchemaExport but it only creates migrations.

OTHER TIPS

While SchemaUpdate very much answers my needs, it still has several problems. For example it refuses to put a new restriction on existing database column even if it's not gonna conflict with existing data.

I'm going froward to extend SchemaUpdate a little bit or, if fail, switch to one of that hand driven migration tools (for example Rails one).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top