title: The operation failed because an index or statistics with name 'IX_ID' already exists on table 'TestAs'?
body: <p>I'm using EF4.3.1 code first, I have the code as below,</p>
  
  <pre><code> namespace ConsoleApplication5
  {
      class Program
      {
          static void Main(string[] args)
          {
              using (var context = new myContext())
              {
                  TestA ta = new TestA();
                  ta.Name = "Hero";
                  TestB tb = new TestB();
                  tb.Name = "Allen";
                  TestC tc = new TestC();
                  tc.Name = "Iverson";
                  ta.tb = tb;
                  ta.tc = tc;
                  context.testASet.Add(ta);
              }
          }
      }
  
      class TestA
      {
          public int ID { get; set; }
  
          public string Name { get; set; }
  
          public TestB tb { get; set; }
  
          public TestC tc { get; set; }
      }
  
      class TestB
      {
          public int ID { get; set; }
  
          public string Name { get; set; }
  
          public TestA ta { get; set; }
      }
  
      class TestC
      {
          public int ID { get; set; }
  
          public string Name { get; set; }
  
          public TestA ta { get; set; }
      }
  
      class myContext : DbContext
      {
          public DbSet&lt;TestA&gt; testASet { get; set; }
          public DbSet&lt;TestB&gt; testBSet { get; set; }
          public DbSet&lt;TestC&gt; testCSet { get; set; }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Entity&lt;TestB&gt;().HasOptional(x =&gt; x.ta).WithRequired();
              modelBuilder.Entity&lt;TestC&gt;().HasOptional(x =&gt; x.ta).WithRequired();
  
              modelBuilder.Entity&lt;TestA&gt;().Property(x =&gt; x.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
              modelBuilder.Entity&lt;TestB&gt;().Property(x =&gt; x.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
              modelBuilder.Entity&lt;TestC&gt;().Property(x =&gt; x.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  
  
          }
      }
  }
  </code></pre>
  
  <p>When I debug the project, the exception is thrown, "The operation failed because an index or statistics with name 'IX_ID' already exists on table 'TestAs'."
  But, if I remove 'TestC' from the code, only 'TestA' and 'TestB', modify the code as below,</p>
  
  <pre><code>namespace ConsoleApplication5
  {
      class Program
      {
          static void Main(string[] args)
          {
              using (var context = new myContext())
              {
                  TestA ta = new TestA();
                  ta.Name = "Hero";
                  TestB tb = new TestB();
                  tb.Name = "Allen";               
                  ta.tb = tb;
                  context.testASet.Add(ta);
              }
          }
      }
  
      class TestA
      {
          public int ID { get; set; }
  
          public string Name { get; set; }
  
          public TestB tb { get; set; }
  
      }
  
      class TestB
      {
          public int ID { get; set; }
  
          public string Name { get; set; }
  
          public TestA ta { get; set; }
      }
  
  
      class myContext : DbContext
      {
          public DbSet&lt;TestA&gt; testASet { get; set; }
          public DbSet&lt;TestB&gt; testBSet { get; set; }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Entity&lt;TestB&gt;().HasOptional(x =&gt; x.ta).WithRequired();
  
              modelBuilder.Entity&lt;TestA&gt;().Property(x =&gt; x.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
              modelBuilder.Entity&lt;TestB&gt;().Property(x =&gt; x.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  
          }
      }
  } 
  </code></pre>
  
  <p>everything works well. Anybody know why the exception was thrown?</p>