Mix of owned and normal entity types in hierarchy should cause validation error #10200
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
Milestone
Observed Behavior
Using the following setup with an Address class that is used as an Owned Entity and as a base class for the ContactAddress class:
Creating the initial migration works as expected - the ContactAddress table does not have a Discriminator column but the ContextModelSnapshot does show Discriminator column:
All subsequent migrations, even if no changes were made, result in the following:
If you run dotnet ef database update it gives the error:
Expected Behavior
The ContextModelSnapshot would not have any reference to a Discriminator column for an Owned Type, and migrations would not continuously
DropColumn(name: "Discriminator")
andAddColumn(name: "Discriminator")
Steps to reproduce
Further technical details
EF Core version: 2.0.0
Database Provider: Microsoft.EntityFrameworkCore.SqlServer 2.0.0
Operating system: Microsoft Windows 10 Pro Version 1709 OS Build 16299.19
IDE: Visual Studio 2017 15.4.1, VS Code 1.17.2
The text was updated successfully, but these errors were encountered: