Open noelex opened 1 month ago
Note: Works correctly with Microsoft.EntityFrameworkCore.SqlServer
. So probably SQLite provider specific.
https://github.com/dotnet/efcore/blob/90d079985f33ae91c05b98ecf65e0ce38270ba55/src/EFCore.Sqlite.Core/Metadata/Internal/SqliteAnnotationProvider.cs#L68
This line might be problematic since PropertyMappings
may contain a shadow ColumnMapping
for the owned entity:
ColumnMapping: OwnedEntity.SomeRandomEntityId - SomeRandomEntity.Id
ColumnMapping: SomeRandomEntity.Id - SomeRandomEntity.Id
Things will only work when the first ColumnMapping
happens to be the right one.
And these may also cause problems? https://github.com/dotnet/efcore/blob/90d079985f33ae91c05b98ecf65e0ce38270ba55/src/EFCore.Relational/Metadata/IColumn.cs#L26-L72
Consider the following configuration:
dotnet ef migrations add
generates a migration with the following code:Note that
Sqlite:Autoincrement
is missing onId
. This can be 'fixed' by either changing the name of the entity toMyEntity
:or by removing
Owned
property:Reverting
Microsoft.EntityFrameworkCore.Sqlite
andMicrosoft.EntityFrameworkCore.Design
to6.0.33
also fixes the issue.EF Core version:
8.0.8
Database provider:Microsoft.EntityFrameworkCore.Sqlite
Target framework:net-8.0