You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sqlite:Autoincrement is not generated for key column when the entity has owned property #34608
I checked this against current releases. With the model from the issue, the generated migration has Sqlite:Autoincrement on EF 9.0.9 and 10.0.0, but it is missing on 8.0.8 and 8.0.31. On 9.0+ the column's property mappings come out with the principal key first, so SqliteAnnotationProvider.For(IColumn) reads the right property. It looks like this was fixed as a side effect in 9.0, so it could probably be closed, unless an 8.0 servicing fix is wanted.
Note
Drafted with AI assistance (Claude Code) and reviewed by me.
Thanks @mauri0686 for letting us know. At the moment I don't see a need for backporting, but if anybody has a strong reason, let us know and we'll reconsider.
Activity
cincuranet commentedon Sep 4, 2024
Note: Works correctly with
Microsoft.EntityFrameworkCore.SqlServer. So probably SQLite provider specific.noelex commentedon Sep 6, 2024
efcore/src/EFCore.Sqlite.Core/Metadata/Internal/SqliteAnnotationProvider.cs
Line 68 in 90d0799
This line might be problematic since
PropertyMappingsmay contain a shadowColumnMappingfor the owned entity:Things will only work when the first
ColumnMappinghappens to be the right one.And these may also cause problems?
efcore/src/EFCore.Relational/Metadata/IColumn.cs
Lines 26 to 72 in 90d0799
mauri0686 commentedon Sep 27, 2026
I checked this against current releases. With the model from the issue, the generated migration has
Sqlite:Autoincrementon EF 9.0.9 and 10.0.0, but it is missing on 8.0.8 and 8.0.31. On 9.0+ the column's property mappings come out with the principal key first, soSqliteAnnotationProvider.For(IColumn)reads the right property. It looks like this was fixed as a side effect in 9.0, so it could probably be closed, unless an 8.0 servicing fix is wanted.Note
Drafted with AI assistance (Claude Code) and reviewed by me.
cincuranet commentedon Oct 8, 2026
Thanks @mauri0686 for letting us know. At the moment I don't see a need for backporting, but if anybody has a strong reason, let us know and we'll reconsider.