Open kroatti opened 5 months ago
I have the same issue with SQL Server i created a reproduction here:
https://github.com/vasicvuk/ef-core-issue-33591
I also reported this to the EF community since I didn't know where the issue is:
https://github.com/dotnet/efcore/issues/33591
Maybe @roji can help with this one
Duplicate of #191
Hi, just hit same issue with a TPT hierarchy & UseSnakeCaseNamingConvention()
, The migration will not generate the redundant constraints with default EF Core casing. Also on 8.0.3.
I'm using table per type inheritance model and owned types in the same class hierarchy. When I generate the migration an extra foreign key constraint will be added to the derived type. Executing the update database returns an error:
The model:
Model configuration:
DbContext builder:
Generated migration:
FK_DERIVEDTYPES_DERIVEDTYPES_ID
is redundant and its name is incorrect. When I don't useUseUpperCaseNamingConvention()
orUseSnakeCaseNamingConvention()
the migration is generated properly.Used packages: