feat(db): add SourceNode column to SiteCalls
This commit is contained in:
Generated
+1654
File diff suppressed because it is too large
Load Diff
+42
@@ -0,0 +1,42 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds the <c>SourceNode</c> column to the central <c>SiteCalls</c> table (#22,
|
||||
/// SourceNode-stamping). <c>SourceNode</c> identifies the cluster node that produced the
|
||||
/// row (e.g. <c>node-a</c>, <c>central-a</c>) — ASCII-only, so <c>varchar(64)</c> not
|
||||
/// <c>nvarchar</c>. <c>NULL</c> is valid for rows that pre-date this feature and for
|
||||
/// reconciled rows from a retired node.
|
||||
///
|
||||
/// The change is purely additive: <c>SourceNode varchar(64) NULL</c> is added with no
|
||||
/// default, so the operation is a metadata-only <c>ALTER TABLE … ADD</c>. The
|
||||
/// <c>SiteCalls</c> table is NOT partitioned (operational state, not audit), so a plain
|
||||
/// <c>ADD</c> is fine. No index — Site Call Audit KPIs are per-site, not per-node, on
|
||||
/// this table; <c>SourceNode</c> is operational metadata, never a query predicate here.
|
||||
/// Historical rows stay <c>NULL</c>.
|
||||
/// </summary>
|
||||
public partial class AddSiteCallSourceNode : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "SourceNode",
|
||||
table: "SiteCalls",
|
||||
type: "varchar(64)",
|
||||
maxLength: 64,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SourceNode",
|
||||
table: "SiteCalls");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,6 +262,10 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
b.Property<int>("RetryCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SourceNode")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)");
|
||||
|
||||
b.Property<string>("SourceSite")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
|
||||
Reference in New Issue
Block a user