I am working with the latest ASP.NET Core 1.0 and EF7.
I created a new ASP.NET Core 1.0 MVC Web application from scratch and running the initial migration was simple:
dnx ef migrations add Initial
dnx ef database update
(I don't think I needed to run this database update command but did anyway)
Additionally I have the following as the constructor of my DbContext which I don't think I need either:
public ApplicationDbContext()
{
Database.EnsureCreated();
}
After creating the Initial migration I noticed that a table for any DbSet in my DbContext was added to the database.
Now I simply added one more model, and added one more DbSet for that model in my DbContext and ran the following:
dnx ef migrations add BookMigration
dnx ef database update
When calling database update I noticed migrations tries to run and create tables for all migrations everything rather than just applying only my new migrations.
Is this a bug? How can I prevent this?