views:

317

answers:

1

I'm using Fluent NHibernate for my mappings and the SchemaExport class to the database schema.

Is it possible with NHibernate to set a default value for a property/column in the generated database schema?

+1  A: 

Not to my knowledge, no - not in the generated schema.

You can just set the property in your constructor though.

Alun Harford
I didn't think so. I'm resulting to just setting it in the constructor for now as you've said. It just means when updating an existing database schema from a newly exported schema from the mappings I have to go thru a manual process to add it.
Luke Smith