Description
openedon Jan 1, 2021
The issue seems to happen when the model combines owned entities with data seeding. I am sending a sample project reproducing the issue attached. I am using EF Core is 5.0.1.
The project contains a barebones ApplicationDbContext
and a class implementing IEntityTypeConfiguration
for an ApplicationUser class and another, almost empty, entity. For some reason, apparently the presence of a Guid field serving as an alternate key was also necessary to trigger the issue, but I could have been mistaken.
To reproduce the problem, run
add-migration a
add-migration b
and inspect the generated migrations. They are exactly the same, dropping and adding exactly the same tables and the same data (i.e. so in reality, both migrations should have been empty since nothing had changed in the model).
Include provider and version information
EF Core version: 5.0.1
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 5.0
Operating system: Windows 10
IDE: 16.9 preview 1