Repository navigation
Validate and uniquify complex-property column names - #39290
Conversation
…hierarchies Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Renaming generated concurrency-token columns can leave table-sharing dependents without required mappings, causing model validation to fail.
1 open issue
What changed in this PR
This PR strengthens EF Core’s relational column validation and naming for complex properties.
Changes:
- Detects collisions across complex paths and inherited mappings.
- Uniquifies convention-generated names while respecting explicit configuration and intentional sharing.
- Adds regression coverage and model-building guidance.
| File | Description |
|---|---|
| test/EFCore.Relational.Tests/Metadata/Conventions/SharedTableConventionTest.cs | Tests naming collisions, inheritance, and configuration precedence. |
| test/EFCore.Relational.Tests/Infrastructure/RelationalModelValidatorTest.cs | Tests invalid collisions and permitted sharing. |
| src/EFCore.Relational/Metadata/Conventions/SharedTableConvention.cs | Refines hierarchy-aware column uniquification. |
| src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs | Validates inherited properties and containing entity hierarchies. |
| .agents/skills/model-building/SKILL.md | Documents the generated-column uniqueness requirement. |
Review effort: Balanced
Co-authored-by: AndriySvyryd <[email protected]>
Agent evaluation:
|
Code coverage overviewLanguages: C# C# / code-coverage
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Co-authored-by: AndriySvyryd <[email protected]>
Agent harness evaluation is staleEvaluation does not run automatically for new commits. A contributor with write access can comment |
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>

Complex-property columns could collide across complex paths or inherited mappings without being rejected. Convention exemptions could also leave distinct properties sharing a generated column name.
Validation
Uniquification
Regression coverage