title: Entity framework code first generates DB column for property that does not exist on the model
body: <p>I'm using Entity framework 5.0 code first. My model class looks like this:</p>
  
  <pre><code>    public class Client
  {
      public Client()
      {
      }
  
      public int ClientID { get; private set; }
      [Required]
      public string CustomerNumber { get; set; }
      [Required]
      public string FirstName { get; set; }
      [Required]
      public string LastName { get; set; }
      [Required]
      public MeritalStatus MeritalStatus { get; set; }
      public DateTime? BirthDate { get; set; }
      public Gender Gender { get; set; }
      public string Email { get; set; }
  
      public string Salutation { get; set; }
  
      public string GetFullName()
      {
          return this.FirstName + " " + this.LastName;
      }
  }
  </code></pre>
  
  <p>I use DropCreateDatabase initializer in global.asax:</p>
  
  <pre><code>Database.SetInitializer&lt;SiteObjectContext&gt;(new DropCreateDatabaseIfModelChanges&lt;SiteObjectContext&gt;());
  </code></pre>
  
  <p>So DB is recreated each time model changes. </p>
  
  <p>The database table that is generated looks like this:</p>
  
  <pre><code>CREATE TABLE [dbo].[Clients](
  [ClientID] [int] IDENTITY(1,1) NOT NULL,
  [CustomerNumber] [nvarchar](max) NOT NULL,
  [FirstName] [nvarchar](max) NOT NULL,
  [LastName] [nvarchar](max) NOT NULL,
  [MeritalStatus] [int] NOT NULL,
  [BirthDate] [datetime] NULL,
  [Gender] [int] NOT NULL,
  [Email] [nvarchar](max) NULL,
  [Salutation] [nvarchar](max) NULL,
  [Visa_VisaID] [int] NULL)
  </code></pre>
  
  <p>It somehow produces redundant column Visa_VisaID that
  does not exist on the model. I suspect it can be sort of a cache as it's possible that
  I had this column on the table before.
  Tried dropping database manually, using EF 6 RC instead of 5.0, nothing helps, the column
  reappears on each database recreation.</p>
  
  <p>Visa entity: </p>
  
  <pre><code>    public class Visa
  {
      public Visa()
      {
      }
  
      public int VisaID { get; set; }
      [Required]
      public int ApplicationId { get; private set; }
      [ForeignKey("ApplicationId")]
      public virtual VisaApplication Application { get; set; }
      public int MainApplicantId { get; private set; }
      [ForeignKey("MainApplicantId")]
      public virtual Client MainApplicant { get; set; }
      public virtual ICollection&lt;Client&gt; IncludedCustomers { get; set; }
      public int VisaTypeId { get; private set; }
      [ForeignKey("VisaTypeId")]
      public virtual VisaType VisaType { get; set; }
      public DateTime StartDate { get; set; }
      [Required]
      public bool IsMultiple { get; set; }
      [Required]
      public DateTime ExpiryDateStay { get; set; }
      public DateTime ExpiryDateTravel { get; set; }
      [Required]
      public DateTime FirstEntryBy { get; set; }
      [Required]
      public string Number { get; set; }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any help is appreciated.</p>