title: EF Migrations: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
body: <p>I had these classes</p>
  
  <pre><code>public class Bid : ...
  {
     ...
  
     [Required]
     public virtual TraderUser Trader { get; set; }
  }
  
  public class TraderUser : ...
  {
     ...
  }
  </code></pre>
  
  <p>I then changed these classes in the following way and added a new class</p>
  
  <pre><code>public class Bid : ...
  {
     ...
  
     [Required]
     public virtual TraderUser TraderUser { get; set; }
  }
  
  public class TraderUser : ...
  {
     ...
  
     public int TraderCompanyId { get; set; }
  
     [ForeignKey("TraderCompanyId")]
     public virtual TraderCompany TraderCompany { get; set; }
  }
  
  public class TraderCompany : ...
  {
     ...
  }
  </code></pre>
  
  <p>When I did an <strong>update-database</strong> I got the following error</p>
  
  <blockquote>
    <p>The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
    "FK_dbo.Bid_dbo.TraderUser_TraderUser_Id". The conflict occurred in
    database "LeasePlan.Development", table "dbo.TraderUser", column 'Id'.</p>
  </blockquote>
  
  <p>I can't get the database to update.  Any help is much appreciated.</p>