Files
ScadaBridge/src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Migrations/20260519050659_AddNotificationsTable.cs
T
Joseph Doherty 7b0b9c7365 refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj,
namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated.
ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated.
SQL roles/logins, LDAP domains, CLI command name, and CLI config dir
(~/.scadalink → ~/.scadabridge) also renamed.

Build green; 5 Host.Tests fail awaiting SQL login rename in next commit.
Pre-existing StaleTagMonitor timing flakes unchanged.

Rename script committed at tools/rename-to-scadabridge.sh.
2026-05-28 09:37:45 -04:00

73 lines
3.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
{
/// <inheritdoc />
public partial class AddNotificationsTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Type",
table: "NotificationLists",
type: "nvarchar(32)",
maxLength: 32,
nullable: false,
defaultValue: "Email");
migrationBuilder.CreateTable(
name: "Notifications",
columns: table => new
{
NotificationId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Type = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
ListName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
Subject = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
Body = table.Column<string>(type: "nvarchar(max)", nullable: false),
TypeData = table.Column<string>(type: "nvarchar(max)", nullable: true),
Status = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
RetryCount = table.Column<int>(type: "int", nullable: false),
LastError = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true),
ResolvedTargets = table.Column<string>(type: "nvarchar(max)", nullable: true),
SourceSiteId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
SourceInstanceId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
SourceScript = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
SiteEnqueuedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
LastAttemptAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
NextAttemptAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
DeliveredAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Notifications", x => x.NotificationId);
});
migrationBuilder.CreateIndex(
name: "IX_Notifications_SourceSiteId_CreatedAt",
table: "Notifications",
columns: new[] { "SourceSiteId", "CreatedAt" });
migrationBuilder.CreateIndex(
name: "IX_Notifications_Status_NextAttemptAt",
table: "Notifications",
columns: new[] { "Status", "NextAttemptAt" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Notifications");
migrationBuilder.DropColumn(
name: "Type",
table: "NotificationLists");
}
}
}