EF Migrations drops index when adding compsite index
问题 I noticed EF removed an index on a foreign key when I added a composite index with the foreign key. So I need to understand composite indexes better :) I added the composite index using this answer and generated my EF code first migration file. Adding composite index: this.Property(x => x.Name) .HasUniqueIndexAnnotation("IX_UniqueNamePerKey", 0); this.Property(x => x.TeacherId) .HasUniqueIndexAnnotation("IX_UniqueNamePerKey", 1); Migration file: public partial class CompositeIndex :