Fix: EF Core scaffold maps a PostgreSQL partial unique index as one-to-one instead of one-to-many
dotnet ef dbcontext scaffold treats any unique index on the FK columns as one-to-one, even with a WHERE filter. Override VisitForeignKey in a custom IScaffoldingModelFactory, or add the filter column to the index key. INCLUDE does not help.