chore(db): align SourceNode unicode metadata + document partition-aligned index recipe

Tidies flagged by code review on the T6/T7/T8 migration bundle:

- Add `.IsUnicode(false)` to the three SourceNode EF property mappings to
  match every other ASCII varchar column on the same entities. Physical
  column was already `varchar(64)` because `HasColumnType` wins, but the EF
  model metadata flag was inconsistent.
- Add `unicode: false` to the three AddColumn<string> calls in the migrations
  + their Designer snapshots so the historical snapshots match the model.
- Update the model snapshot to carry IsUnicode(false) on each SourceNode entry.
- Document the SELECT-list invariant on SiteCallAuditRepository.QueryAsync:
  EF Core's FromSqlInterpolated requires every entity-tracked column in the
  result set, so future SiteCall columns must extend the list too.
- Amend plan Task 6 Step 2 to document the partition-aligned raw-SQL index
  recipe and the staging-table sync requirement.
This commit is contained in:
Joseph Doherty
2026-05-23 16:45:19 -04:00
parent 1a77bc5f38
commit 8fb9eb0ce7
12 changed files with 37 additions and 8 deletions
@@ -118,6 +118,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")
@@ -30,6 +30,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
name: "SourceNode",
table: "AuditLog",
type: "varchar(64)",
unicode: false,
maxLength: 64,
nullable: true);
@@ -118,6 +118,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")
@@ -825,6 +826,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")
@@ -26,6 +26,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
name: "SourceNode",
table: "Notifications",
type: "varchar(64)",
unicode: false,
maxLength: 64,
nullable: true);
}
@@ -118,6 +118,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")
@@ -267,6 +268,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceSite")
@@ -829,6 +831,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")
@@ -27,6 +27,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
name: "SourceNode",
table: "SiteCalls",
type: "varchar(64)",
unicode: false,
maxLength: 64,
nullable: true);
}
@@ -115,6 +115,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")
@@ -264,6 +265,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceSite")
@@ -826,6 +828,7 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
b.Property<string>("SourceNode")
.HasMaxLength(64)
.IsUnicode(false)
.HasColumnType("varchar(64)");
b.Property<string>("SourceScript")