I'm going to go ahead and propose a migrations framework for NHibernate. 
 As I see it this is really 2 distinct features:

*The Operations DDL generation framework -- NH-3639 
<https://nhibernate.jira.com/browse/NH-3639>*
There should be a core DDL generation framework in NHibernate proper which 
supports the existing hbm2ddl tools and is flexible enough to support a 
more full featured migrations framework. This framework would provide a 
much more complete set of unit tests around the ddl geneation tools. 
 Additionally it could be used in some areas of the framework which do DDL 
in a less than optimal manner such as the table-based poid generators. 
Rolling the ddl generation out of Mappings and into its own framework would 
greatly simplify the mapping classes.  This framework should be independent 
of the mappings because it will not always execute in the context of a 
mapping.  It should also be flexible enough for migrations to define higher 
level operations such as renaming a table or creating a schema without 
depending on the core framework to provide that.

At the core of this framework is the IDdlOperation interface:

public interface IDdlOperation
{
    IEnumerable<string> GetStatements(NHibernate.Dialect.Dialect dialect);
}

Concrete implementations of operations will accept dedicated models with 
names appropriately quoted and qualified, and typecodes pre-resolved. For 
example the CreateTableOperation would accept a CreateTableModel in it's 
constructor which would include definitions of columns, the primary key, 
unique indexes, foreign keys and check expressions.  Where as the 
DropTableOperation would merely need to accept a quoted and qualified table 
name.  On top of this I can build:

*The NHibernate.Migrations framework*

This framework starts with a domain specific language to more easily define 
migrations on top of the Operations DDL framework.  It will also contain a 
versioning and execution framework to make deployment easier.  On top of 
those I can build Migtation DSL generator. The versioning framework will be 
flexible enough to allow for more than just a table of deployed versions.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to