Fluent NHibernate many-to-many create clustered index on link table

I have two entities in a many-to-many relationship.

 public class SecurityGroupMappingOverride : IAutoMappingOverride<SecurityGroup>
{
    public void Override(AutoMapping<SecurityGroup> mapping)
    {
        mapping.HasManyToMany(x => x.Actions).ParentKeyColumn("securityGroupId").ChildKeyColumn("actionId").
            LazyLoad().Table("ActionGroups");

        mapping.HasManyToMany(x => x.Members).ParentKeyColumn("securityGroupId").ChildKeyColumn("userId").
            LazyLoad().Inverse().Table("UserGroups");

        mapping.Map(x => x.Name).Length(64);

    }
}

So I want to create an clustered index on both columns (userId, securityGroupId) from table UserGroups.

Or just to create a Primary Key on UserGroups on them both columns, as at same time could not be two same links.

Thanks

6
задан Adam Dymitruk 11 May 2011 в 02:02
поделиться