I have an ASP.NET Core application that use SQL Server and EF Core. It contains two tables. I successfully created an Entity Framework Core migration and updated the database with it for the first table called Pies
.
Then after I added another table called Feedbacks
, I created a second migration.
However, when I attempt to update the database, it fails and I get this error:
Error Number:2714,State:6,Class:16
There is already an object named 'Pies' in the database.
Here is the DbContext
class:
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
{
}
public DbSet<Pie> Pies { get; set; }
public DbSet<Feedback> Feedbacks { get; set; }
}