title: How to Update model and database with code first approach in Asp.net MVC
body: <p>I'm new to <code>mvc</code>. I've creted an <code>MVC</code> app, in which i have used <code>code first</code> approach. Right now i have two tables <strong>Deal</strong> and <strong>Comment</strong>. Now i want to add a new table <strong>Category</strong> in the database and new column <strong>categoryId</strong> in <strong>Deal</strong> table.</p>
  
  <p>How i can update database and model?</p>
  
  <p>I'm using <code>Sql Server 2008 R2</code> for Database.</p>
  
  <p><strong>I've following structure of class:</strong></p>
  
  <pre><code>      namespace FBWebApp.Models
      {
          public class Deal
        {
          public int ID { get; set; }                 // ID
          public string Title { get; set; }           // Titolo del deal   
          public string Description { get; set; }     // Descrizione dell'annuncio
          public string FacebookUID { get; set; }     // UID facebook dell'utente
          public string Visibility { get; set; }      // Visibility
          public string Category { get; set; }
          public int Option1 { get; set; }
          public int Option2 { get; set; }
          public int Option3 { get; set; }
          public int Option4 { get; set; }
          public string PhotoURL { get; set; }    // URL of the facebook photo profile 
          public string Name { get; set; }        // Name of the user
          public string ProfileUrl { get; set; }  // URL of the facebook profile
          public string Photo1 { get; set; }  // URL of the Photo1 (local )
          public string Photo2 { get; set; }
          public string Photo3 { get; set; }
          public string Photo4 { get; set; }
          public string Photo5 { get; set; }
      }
      public class Comment
      {
          [Key]
          public int CommentId { get; set; }
          public string CommentText { get; set; }
          public int ID { get; set; }
          [ForeignKey("ID")]
          public Deal DelNav { get; set; }
      }
  
      public class DealDBContext : DbContext
      {
  
          public DealDBContext() : base("DealDBContext") { }
          public DbSet&lt;Deal&gt; Deals { get; set; }
          public DbSet&lt;Comment&gt; Comments { get; set; }
  
      }
  }
  </code></pre>