Repository navigation
Preserve inherited HiLo sequences in model snapshots - #4031
Merged
Merged
Conversation
Resolve property-level HiLo snapshot arguments from model configuration when not explicitly overridden, avoiding spurious sequence drops and pending model changes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7c022835-8a88-4ace-928d-d54de023982f
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The localized fix preserves existing behavior, includes focused regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes HiLo snapshot generation to preserve inherited sequence settings, preventing unwanted default sequences and repeated migrations.
Changes:
- Falls back to model-level HiLo names and schemas while preserving property overrides.
- Adds regression coverage for inherited settings and explicit overrides.
| File | Description |
|---|---|
| test/EFCore.PG.Tests/Design/Internal/NpgsqlAnnotationCodeGeneratorTest.cs | Tests inherited HiLo settings and property overrides. |
| src/EFCore.PG/Design/Internal/NpgsqlAnnotationCodeGenerator.cs | Adds model-level fallback for property HiLo calls. |
Review effort: Balanced
This was referenced Oct 18, 2026
roji
added a commit
that referenced
this pull request
Oct 18, 2026
Backport #4031 to 10.0, preserving inherited model-level HiLo sequence names and schemas in property snapshot calls. (cherry picked from commit bde0e12) Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5725ac6e-9b69-43e1-8a39-e7a04e845a83
roji
added a commit
that referenced
this pull request
Oct 18, 2026
Backport bde0e12 from #4031 for #3613. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 373754c9-0387-441e-ad12-c24b8ed792b1
roji
added a commit
that referenced
this pull request
Oct 18, 2026
Backport #4031 for #3613. Resolve property-level HiLo snapshot arguments from model configuration while preserving explicit property overrides. (cherry picked from commit bde0e12) Co-authored-by: Copilot App <[email protected]> Copilot-Session: 2cb7624f-a080-43fe-b454-f33de1b9f32d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom model-level HiLo sequences currently generate parameterless property-level
UseHiLo()calls in snapshots. Rebuilding the snapshot creates an unwanted default sequence, causing repeatedDropSequencemigrations and pending-model-change errors.Fall back to the model's HiLo sequence name and schema when generating property calls, while preserving explicit property overrides and existing model-level behavior. Adds regression coverage for inherited names/schemas and property overrides.
Corresponding SQL Server fix: dotnet/efcore#39325.
Fixes #3613