I noticed the DDL that gets generated by Fluent doesn't create PK for
the 2 columns that make up the table for many-to-many relationship.

For example (from the first example),

Store <-- many-to-many --> Product

In StoreProduct table, you'd have 2 columns:

ProductFK, StoreFK

This StoreProduct table (i.e. the Store-Product bridge table) is
implicitly generated via Fluent's HasManyToMany statement. I'd like to
make it generate DDL that defines the 2 columns as PK.

This is what gets generated by Fluent for SQLite at the moment:

create table StoreProduct
(ProductFK INT not null,
StoreFK INT not null,
constraint FKE9A26716DC700501 foreign key (StoreFK) references
"Store",
constraint FKE9A26716815A48A8 foreign key (ProductFK) references
"Product");

I'd like it to do this:

create table StoreProduct
(ProductFK INT not null,
StoreFK INT not null,
constraint FKE9A26716DC700501 foreign key (StoreFK) references
"Store",
constraint FKE9A26716815A48A8 foreign key (ProductFK) references
"Product",
PRIMARY KEY(ProductFK, StoreFK));

I understand that EF 4.1 Code First automatically does that without
any additional instructions. In fact, shouldn't this be the default?

Is that even possible with Fluent?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to