using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ScadaLink.ConfigurationDatabase.Migrations { /// /// Adds the SourceNode column to the central Notifications table (#21, /// SourceNode-stamping). SourceNode identifies the cluster node that produced the /// notification (e.g. node-a, central-a) — ASCII-only, so varchar(64) /// not nvarchar. NULL is valid for rows that pre-date this feature. /// /// The change is purely additive: SourceNode varchar(64) NULL is added with no /// default, so the operation is a metadata-only ALTER TABLE … ADD. Unlike /// AuditLog, the Notifications table is NOT partitioned, so a plain /// ADD is fine. No index — Notification Outbox KPIs are per-site, not per-node, /// on this table; SourceNode is only echoed onto NotifyDeliver audit rows /// (#23) for cross-row correlation. Historical rows stay NULL. /// public partial class AddNotificationSourceNode : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "SourceNode", table: "Notifications", type: "varchar(64)", maxLength: 64, nullable: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "SourceNode", table: "Notifications"); } } }