title: How to use Code first Migration for Primary Key?
body: <p>At the biginning, I defined the model like this:</p>
  
  <pre><code>public class Category
  {
    public long CategoryId { get; set;}
    public string CategoryName { get; set; } 
    public virtual ICollection&lt;ContentInfo&gt; Contents { get; set; }
  }
  
  Public class Article
  {
    public int ContentId { get; set; }
    public string Content { get; set; }
    [ForeignKey("Category")]
    public long CategoryId { get; set; }
    public virtual Category Category { get; set; }
  }
  </code></pre>
  
  <p>After generating the database from the model with Automatic-Migration, I changed the  CategoryId's type from "long" to "int", and update the database with Automatic-Migration again. </p>
  
  <p>This time an exception was throwed, telling me The column "CategoryId" was referenced by Primary key and Foreign Key, so the migration is failed. If i delete the Primary key and Foreign Key manually, everything is ok. but i want the Automatic-Migration to do this for me, can it?</p>