I\'ve seen the various blog posts concerning nHibernate\'s SchemaUpdate
, and even Ayende\'s
very good example, and downloaded the samples, but for some
Your example works well for me (NH3.1, FNH 2.1). SchemaUpdater checks current database schema and creates correct alter scripts. All generated script fragments are exposed to UpdateSchema. No problem here. The only one detail which I was confused by is file mode access:
SchemaUpdater.Execute(updateExport, false);
Maybe it would be better to remove the output file before schema update.
The generated script can be executed automatically (doUpdate parameter is true):
SchemaUpdater.Execute(updateExport, true);
I don't know if it is your case but I'm happy now - your code snippet solved some of my problems. Thanks for inspiration:).