>> In the start we should just add this in addition to the normal way as
part of our move towards 1.0
Oh totally - you still need the current way in any case as it allows
you to create foreign keys on tables that were added in previous
migrations (can't think of a use case at the moment for that, but I'm
sure it would come up if we took it out).
>> I'm wondering about multi-db support with this approach
I don't really think this approach would be at all different to the
current approach in regard to multi-db support - it is just a more
fluent way of expressing the same thing. In fact, to the
IMigrationContext it should look the same:
- when you first call .CreateTable it will add the
CreateTableExpression to the IMigrationContext and returns a
CreateTableExpressionBuilder
- then, when you call .WithColumn on the table builder, it adds a
column to the previously created expression and returns the table
builder (with a column-adding-oriented interface)
- then, when you call ".References" on the table builder, it would
add a new CreateForeignKeyExpression to the IMigrationContext and
return the table builder with the column-adding-oriented interface
My only question is how to get the reference to the IMigrationContext
from the table builder? It looks like I may have to change the
CreateTableExpressionBuilder to have a reference to the context.
Sorry, most of that was me walking myself through the solution as I
learned the codebase. =)
Troy
On May 5, 5:44 pm, Sean Chambers <
schamber...@gmail.com> wrote:
> Big +1 from me.
>
> We have a lo of noise around adding foreign keys in one of our apps
> and this would save that.
>
> I would go ahead and implement it as you have it and see how it works
> out. I have a feeling there's something I'm forgetting but we can
> cross that bridge if/when we get there. The only thing that may cause
> a problem is mixing table creation with creating a foreign key and you
> may have to dance around the api a bit.
>
> In the start we should just add this in addition to the normal way as
> part of our move towards 1.0, I have a feeling removing the existing
> foreign key creation would break too many people.
>
> Anyone else think Of anything?
>
> Thanks!
>
> Sean
>
> > For more options, visit this group athttp://
groups.google.com/group/fluentmigrator-google-group?hl=en