Repository navigation
[8.0] Fix precision-only numeric migration snapshot churn - #4068
Merged
Merged
Conversation
Backport the final net diff of #4065 (820a869) for #3521. Omit only inferred precision-only numeric column types during snapshot generation; leave explicit types, scales, and runtime mappings unchanged. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 12f9ca8d-c1bf-46b0-bb94-40fe18290c21
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.
Backports the final net diff of #4065 (source head
820a86955abaa7cfca27526fbdc8bbe168531cc6) tohotfix/8.0.12for #3521. The source PR is currently open and unmerged.For precision-only numeric properties, snapshots currently store an inferred
numeric(p)column type that reloads asnumeric(p,0), causing false model differences and repeated migrations. Omit only this inferred annotation so the existingHasPrecision(p)reconstructs the original mapping. Explicit column types and scales remain unchanged.Backport safety: Low risk: the production change is confined to the existing design-time property annotation generator. Runtime type mappings, generated SQL, dependencies, and public APIs are untouched. EF Core 8.0.32's snapshot generator uses the same hook and emits
HasPrecision(p)separately. Existing affected snapshots require one regeneration; this does not retroactively rewrite them.Validation: Used the branch-selected .NET 8.0.425 SDK and unchanged pinned dependencies. The new precision-only regression failed before the fix; afterward all 27
NpgsqlAnnotationCodeGeneratorTestcases passed, including explicit column types and scales. No API adaptations were necessary.Fixes #3521.