title: Entity Framework invalid object name "dbo.EA_EmployeePerformance"
body: <p>It is weird since I use the simple membership initialization my EF model cannot create a new table. My code was able to create the new table needed if there is a transaction required for the model.</p>
  
  <p>This is my model :</p>
  
  <pre><code>public class EmployeeDBContext : DbContext
  {
      public EmployeeDBContext()
          : base("DefaultConnection")
      {
          Database.SetInitializer&lt;EmployeeDBContext&gt;(new CreateDatabaseIfNotExists&lt;EmployeeDBContext&gt;());
      }
  
      public DbSet&lt;EA_Employee&gt; Employees { get; set; }
      public DbSet&lt;EA_EmployeePerformance&gt; EmployeePerformances { get; set; }
      public DbSet&lt;EA_EmployeeRank&gt; EmployeeRanks { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Conventions.Remove&lt;OneToManyCascadeDeleteConvention&gt;();
          modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
      }
  }
  
  [Table("EA_EmployeePerformance")]
  public class EA_EmployeePerformance
  {
      [Key]
      [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
      [Display(Name = "Employee Performance Id")]
      public int EmployeePerformanceId { get; set; }
  
      [Index("Performance", IsUnique = true)]
      [MaxLength(20)]
      [Required]
      public string Performance { get; set; }
  
      public EA_EmployeePerformance()
      {
          Performance = "";
      }
  }
  </code></pre>
  
  <p>Whenever I SaveChanges(), the DB throws me </p>
  
  <blockquote>
    <p>"Invalid object name dbo.EmployeePerformance".</p>
  </blockquote>
  
  <p>I check the database and the database only contains tables required from simple membership.</p>
  
  <p>How can I auto create the tables when a transaction is occurred for that model?</p>
  
  <hr>
  
  <h2>--------- EDITED ---------</h2>
  
  <p>Now I know what is my problem. The problem is because I use multiple dbContext in one database. It is gonna be tricky to do the migration because migration only works on one dbContext isn't it?</p>
  
  <p>So in my case the problem is because the original AccountDBContext from the simple membership is taking over my database, that is why my other dbContext such as the EmployeeDBContext cannot create the new table (please correct me if i'm wrong).</p>
  
  <p>Is there a way for me to keep the multiple dbContexts in a single database?</p>