feat(db): migration for ElementDataType + widen attribute Value to nvarchar(max) (idempotent)

This commit is contained in:
Joseph Doherty
2026-06-16 15:22:29 -04:00
parent 8bd8079a7f
commit 4a4b3d677d
5 changed files with 1802 additions and 8 deletions
@@ -99,8 +99,12 @@ public class InstanceAttributeOverrideConfiguration : IEntityTypeConfiguration<I
.IsRequired()
.HasMaxLength(200);
builder.Property(o => o.OverrideValue)
.HasMaxLength(4000);
// nvarchar(max): List attribute values (JSON arrays) can exceed 4000 chars.
builder.Property(o => o.OverrideValue);
builder.Property(o => o.ElementDataType)
.HasConversion<string>()
.HasMaxLength(50);
builder.HasIndex(o => new { o.InstanceId, o.AttributeName }).IsUnique();
}
@@ -108,8 +108,8 @@ public class TemplateAttributeConfiguration : IEntityTypeConfiguration<TemplateA
.IsRequired()
.HasMaxLength(200);
builder.Property(a => a.Value)
.HasMaxLength(4000);
// nvarchar(max): List attribute values (JSON arrays) can exceed 4000 chars.
builder.Property(a => a.Value);
builder.Property(a => a.Description)
.HasMaxLength(2000);
@@ -121,6 +121,10 @@ public class TemplateAttributeConfiguration : IEntityTypeConfiguration<TemplateA
.HasConversion<string>()
.HasMaxLength(50);
builder.Property(a => a.ElementDataType)
.HasConversion<string>()
.HasMaxLength(50);
builder.HasIndex(a => new { a.TemplateId, a.Name }).IsUnique();
}
}