Skip to content

[9.0] Fix precision-only numeric migration snapshot churn - #4069

Merged
roji merged 1 commit into
hotfix/9.0.5from
roji-decimal-precision-backport-9-0
Oct 21, 2026
Merged

roji merged 1 commit into
hotfix/9.0.5from
roji-decimal-precision-backport-9-0

Conversation

@roji

@roji roji commented Oct 21, 2026

Copy link
Copy Markdown
Member

Backports the final two-file diff from #4065 (820a869) to hotfix/9.0.5 for 9.0.5. The source PR is currently unmerged.

Fixes #3521.

For precision-only numeric properties without an explicitly configured column type, omit the inferred numeric(p) snapshot annotation so HasPrecision(p) reconstructs the original mapping. Explicit column types and scales, runtime type mappings, and SQL rendering remain unchanged. Existing affected snapshots require one regeneration.

This is a narrow, low-risk design-time backport. EF Core 9.0.21 uses the same snapshot-generation hook and emits HasPrecision(p) independently. No dependency or SDK configuration changes.

Validation: all 27 NpgsqlAnnotationCodeGeneratorTest tests pass, including the six numeric-precision cases, with the pinned .NET SDK 9.0.312 and this branch's VSTest runner:

dotnet test test/EFCore.PG.Tests/EFCore.PG.Tests.csproj --filter FullyQualifiedName~NpgsqlAnnotationCodeGeneratorTest --verbosity minimal

Backport the final net diff from #4065 for #3521. Omit only inferred precision-only numeric column types during annotation generation; retain explicit column types and scales.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 6cc44be3-a355-4562-84ca-b67d34a171a5
@roji
roji merged commit 52d23cd into hotfix/9.0.5 Oct 21, 2026
9 checks passed
@roji
roji deleted the roji-decimal-precision-backport-9-0 branch October 21, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrecisionAttribute on Decimal parameter causes false positive for PendingModelChangesWarning exception

1 participant