Prevent Nhibernate schemaexport from generating foreign key constraints on has many relationship
问题 I have a mapping like this: HasMany(x => x.Orders).KeyColumn("CustomerID"); Which is causing a constraint like this to be generated by schemaexport: alter table [CustomerOrder] add constraint FK45B3FB85AF01218D foreign key (CustomerID) references [Customer] I have tried adding .NotFound.Ignore() like on a References() mapping to disable the constraint from being generated but this does not work. Can a mapping be defined that will force SchemaExport to not generate the constraint? 回答1: Figured