Search code examples
.netfluent-nhibernatemigrationmigratordotnet

Do Fluent NHibernate and migratordotnet play nicely together?


I love Fluent NHibernate for building my DBs and so far haven't found a restriction that has halted me in my tracks.

However on my current project I expect to release to production very early in the product lifecycle and hence expect there to be many small changes in the db schema as we progress.

I'd like to track these DDL amd DML changes in "migrations", using a tool like migratordotnet. But my question is: Is it possible to get these two tools (or similar tools) working together?

In the spirit of DRY, how can I derive my schema changes from my mappings in Fluent Nhibernate? Is this possible?

Or is a better approach to leave schema generation to a tool such migratordotnet and leave Fluent NHibernate with the responisibility of mapping only? Hmm, this does seem like a better seperation of concerns at a tool level.

Cheers!


Solution

  • Gordon,

    I've had the same question on previous projects and we've settled on using migratordotnet exclusively for our database migrations and just skipping SchemaUpdate altogether.

    I will still use SchemaUpdate for quick prototypes but once I start the project in earnest I only use migratordotnet.

    With the migrations setup to run as part of our Nightly builds migratordotnet works very well once we have more than one person working on a project.