Fix decimal precision for CategoryMapping.Confidence field

Add explicit column type configuration for Confidence field to avoid
SQL Server truncation warnings. Use decimal(5,4) to store values from
0.0000 to 1.0000 with 4 decimal places of precision.

Also add MaxLength constraint for CreatedBy field.

Migration applied successfully to database.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
AJ
2025-10-12 10:51:47 -04:00
parent 5723ac26da
commit 1aecbf14fe
6 changed files with 696 additions and 1 deletions

View File

@@ -179,6 +179,8 @@ namespace MoneyMap.Data
{
e.Property(x => x.Category).HasMaxLength(100).IsRequired();
e.Property(x => x.Pattern).HasMaxLength(200).IsRequired();
e.Property(x => x.Confidence).HasColumnType("decimal(5,4)"); // 0.0000 to 1.0000
e.Property(x => x.CreatedBy).HasMaxLength(50);
// Merchant (optional). If a merchant is deleted, set to null.
e.HasOne(x => x.Merchant)