Files
lmxopcua/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/Migrations/OtOpcUaConfigDbContextModelSnapshot.cs
T
Joseph Doherty 486628cf0a fix(config): #998 deploy gate rejects duplicate ZTag/SAPID, duplicate owned historian tagnames and dangling parent links; NULL-keyed unique indexes enforced; node/cluster edits carry a RowVersion
C-3 ZTag/SAPID uniqueness enforced from the draft (reservation ledger has no writer); UI/doc claim corrected.
C-5 HistorianTagnameDuplicate (owned tags, per cluster, case-insensitive; readOnly exempt).
C-8 UX_NodeAcl_PrincipalScope / UX_LdapGroupRoleMapping_Group_Cluster unfiltered (migration with duplicate pre-check) + friendly service/page checks.
C-9 RowVersion on ClusterNode/ServerCluster, edit pages use it; node delete removes its NodeDeploymentState rows.
C-10 DanglingReference rule; dead PathTooLong/EquipmentUuidImmutable rules + PriorEquipment/Enterprise/Site inputs deleted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-03 10:49:57 -05:00

2020 lines
78 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ZB.MOM.WW.OtOpcUa.Configuration;
#nullable disable
namespace ZB.MOM.WW.OtOpcUa.Configuration.Migrations
{
[DbContext(typeof(OtOpcUaConfigDbContext))]
partial class OtOpcUaConfigDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("FriendlyName")
.HasColumnType("nvarchar(max)");
b.Property<string>("Xml")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("DataProtectionKeys", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ApiKey", b =>
{
b.Property<Guid>("ApiKeyRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("ApiKeyId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedUtc")
.HasColumnType("datetime2");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<DateTime?>("ExpiresUtc")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("Principal")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("SecretHash")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("ApiKeyRowId");
b.HasIndex("ApiKeyId")
.IsUnique()
.HasDatabaseName("UX_ApiKey_ApiKeyId");
b.HasIndex("Principal")
.HasDatabaseName("IX_ApiKey_Principal");
b.ToTable("ApiKey", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNode", b =>
{
b.Property<string>("NodeId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("AkkaPort")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(4053);
b.Property<string>("ApplicationUri")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<int>("DashboardPort")
.HasColumnType("int");
b.Property<string>("DriverConfigOverridesJson")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int?>("GrpcPort")
.HasColumnType("int");
b.Property<string>("Host")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("nvarchar(255)");
b.Property<DateTime?>("LastSeenAt")
.HasColumnType("datetime2(3)");
b.Property<bool>("MaintenanceMode")
.HasColumnType("bit");
b.Property<int>("OpcUaPort")
.HasColumnType("int");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<byte>("ServiceLevelBase")
.HasColumnType("tinyint");
b.HasKey("NodeId");
b.HasIndex("ApplicationUri")
.IsUnique()
.HasDatabaseName("UX_ClusterNode_ApplicationUri");
b.HasIndex("ClusterId")
.HasDatabaseName("IX_ClusterNode_ClusterId");
b.ToTable("ClusterNode", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNodeCredential", b =>
{
b.Property<Guid>("CredentialId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Kind")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("NodeId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime?>("RotatedAt")
.HasColumnType("datetime2(3)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.HasKey("CredentialId");
b.HasIndex("Kind", "Value")
.IsUnique()
.HasDatabaseName("UX_ClusterNodeCredential_Value")
.HasFilter("[Enabled] = 1");
b.HasIndex("NodeId", "Enabled")
.HasDatabaseName("IX_ClusterNodeCredential_NodeId");
b.ToTable("ClusterNodeCredential", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ConfigAuditLog", b =>
{
b.Property<long>("AuditId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("AuditId"));
b.Property<string>("ClusterId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid?>("CorrelationId")
.HasColumnType("uniqueidentifier");
b.Property<string>("DetailsJson")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("EventId")
.HasColumnType("uniqueidentifier");
b.Property<string>("EventType")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<long?>("GenerationId")
.HasColumnType("bigint");
b.Property<string>("NodeId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Outcome")
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<string>("Principal")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime>("Timestamp")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.HasKey("AuditId");
b.HasIndex("EventId")
.IsUnique()
.HasDatabaseName("UX_ConfigAuditLog_EventId")
.HasFilter("[EventId] IS NOT NULL");
b.HasIndex("GenerationId")
.HasDatabaseName("IX_ConfigAuditLog_Generation")
.HasFilter("[GenerationId] IS NOT NULL");
b.HasIndex("ClusterId", "Timestamp")
.IsDescending(false, true)
.HasDatabaseName("IX_ConfigAuditLog_Cluster_Time");
b.ToTable("ConfigAuditLog", null, t =>
{
t.HasCheckConstraint("CK_ConfigAuditLog_DetailsJson_IsJson", "DetailsJson IS NULL OR ISJSON(DetailsJson) = 1");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ConfigEdit", b =>
{
b.Property<Guid>("EditId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<DateTime>("EditedAtUtc")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("EditedBy")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<Guid>("EntityId")
.HasColumnType("uniqueidentifier");
b.Property<string>("EntityType")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid?>("ExecutionId")
.HasColumnType("uniqueidentifier");
b.Property<string>("FieldsJson")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SourceNode")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("EditId");
b.HasIndex("EditedAtUtc")
.HasDatabaseName("IX_ConfigEdit_EditedAt");
b.HasIndex("ExecutionId")
.HasDatabaseName("IX_ConfigEdit_Execution")
.HasFilter("[ExecutionId] IS NOT NULL");
b.HasIndex("EntityType", "EntityId")
.HasDatabaseName("IX_ConfigEdit_Entity");
b.ToTable("ConfigEdit", null, t =>
{
t.HasCheckConstraint("CK_ConfigEdit_FieldsJson_IsJson", "ISJSON(FieldsJson) = 1");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DataConnection", b =>
{
b.Property<Guid>("DataConnectionRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<int>("AllowedOperations")
.HasColumnType("int");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("Consistency")
.HasColumnType("int");
b.PrimitiveCollection<string>("ConsumerNodeIds")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DataConnectionId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.PrimitiveCollection<string>("EligibleTargetNodeIds")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.PrimitiveCollection<string>("Endpoints")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ExpectedClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ExpectedNodeId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("HistoryTimeoutMilliseconds")
.HasColumnType("int");
b.Property<int>("MaxBatchItems")
.HasColumnType("int");
b.Property<int>("MaxMessageBytes")
.HasColumnType("int");
b.Property<int>("MaxMonitoredItems")
.HasColumnType("int");
b.Property<int>("MaxPageItems")
.HasColumnType("int");
b.Property<long>("MaxPendingBytes")
.HasColumnType("bigint");
b.Property<int>("MaxStreams")
.HasColumnType("int");
b.Property<long>("Revision")
.HasColumnType("bigint");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("SecretReference")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("SecretScopeClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("TargetMode")
.HasColumnType("int");
b.Property<int>("TimeoutMilliseconds")
.HasColumnType("int");
b.HasKey("DataConnectionRowId");
b.HasIndex("ClusterId");
b.HasIndex("DataConnectionId")
.IsUnique()
.HasFilter("[DataConnectionId] IS NOT NULL");
b.ToTable("DataConnection", null, t =>
{
t.HasCheckConstraint("CK_DataConnection_Limits", "[Revision] > 0 AND [TimeoutMilliseconds] > 0 AND [MaxBatchItems] > 0 AND [MaxPageItems] > 0 AND [MaxMessageBytes] > 0 AND [MaxStreams] > 0 AND [MaxMonitoredItems] > 0 AND [MaxPendingBytes] > 0 AND [HistoryTimeoutMilliseconds] > 0");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DataConnectionScopeState", b =>
{
b.Property<int>("Id")
.HasColumnType("int");
b.Property<string>("Fingerprint")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<long>("ScopeVersion")
.HasColumnType("bigint");
b.HasKey("Id");
b.ToTable("DataConnectionScopeState", null, t =>
{
t.HasCheckConstraint("CK_DataConnectionScopeState_Singleton", "[Id] = 1 AND [ScopeVersion] >= 0");
});
b.HasData(
new
{
Id = 1,
ScopeVersion = 0L
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DataExport", b =>
{
b.Property<Guid>("DataExportRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<bool>("AllowGalaxyServiceAck")
.HasColumnType("bit");
b.Property<int>("AllowedOperations")
.HasColumnType("int");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("DataExportId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("MaxBatchItems")
.HasColumnType("int");
b.Property<int>("MaxConcurrentHistoryReads")
.HasColumnType("int");
b.Property<int>("MaxConditions")
.HasColumnType("int");
b.Property<int>("MaxHistoryResponseBytes")
.HasColumnType("int");
b.Property<int>("MaxHistoryValuesPerPage")
.HasColumnType("int");
b.Property<int>("MaxMonitoredItems")
.HasColumnType("int");
b.Property<int>("MaxPageItems")
.HasColumnType("int");
b.Property<int>("MaxStreams")
.HasColumnType("int");
b.Property<string>("PrincipalId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<int>("Realm")
.HasColumnType("int");
b.Property<long>("Revision")
.HasColumnType("bigint");
b.Property<string>("RootEntityId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("RootKind")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.HasKey("DataExportRowId");
b.HasIndex("ClusterId");
b.HasIndex("DataExportId")
.IsUnique()
.HasFilter("[DataExportId] IS NOT NULL");
b.ToTable("DataExport", null, t =>
{
t.HasCheckConstraint("CK_DataExport_Limits", "[Revision] > 0 AND [MaxBatchItems] > 0 AND [MaxPageItems] > 0 AND [MaxMonitoredItems] > 0 AND [MaxStreams] > 0 AND [MaxConcurrentHistoryReads] > 0 AND [MaxHistoryValuesPerPage] > 0 AND [MaxHistoryResponseBytes] > 0 AND [MaxConditions] > 0");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.Deployment", b =>
{
b.Property<Guid>("DeploymentId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<byte[]>("ArtifactBlob")
.IsRequired()
.HasColumnType("varbinary(max)");
b.Property<DateTime>("CreatedAtUtc")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("FailureReason")
.HasMaxLength(2048)
.HasColumnType("nvarchar(2048)");
b.Property<string>("RevisionHash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<DateTime?>("SealedAtUtc")
.HasColumnType("datetime2(3)");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("DeploymentId");
b.HasIndex("CreatedAtUtc")
.HasDatabaseName("IX_Deployment_CreatedAt");
b.HasIndex("Status")
.HasDatabaseName("IX_Deployment_Status");
b.ToTable("Deployment", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.Device", b =>
{
b.Property<Guid>("DeviceRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("DeviceConfig")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("DriverInstanceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.HasKey("DeviceRowId");
b.HasIndex("DeviceId")
.IsUnique()
.HasDatabaseName("UX_Device_LogicalId")
.HasFilter("[DeviceId] IS NOT NULL");
b.HasIndex("DriverInstanceId")
.HasDatabaseName("IX_Device_Driver");
b.HasIndex("DriverInstanceId", "Name")
.IsUnique()
.HasDatabaseName("UX_Device_Driver_Name");
b.ToTable("Device", null, t =>
{
t.HasCheckConstraint("CK_Device_DeviceConfig_IsJson", "ISJSON(DeviceConfig) = 1");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DriverInstance", b =>
{
b.Property<Guid>("DriverInstanceRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("DriverConfig")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DriverInstanceId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("DriverType")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("RawFolderId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ResilienceConfig")
.HasColumnType("nvarchar(max)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.HasKey("DriverInstanceRowId");
b.HasIndex("ClusterId")
.HasDatabaseName("IX_DriverInstance_Cluster");
b.HasIndex("DriverInstanceId")
.IsUnique()
.HasDatabaseName("UX_DriverInstance_LogicalId")
.HasFilter("[DriverInstanceId] IS NOT NULL");
b.HasIndex("RawFolderId")
.HasDatabaseName("IX_DriverInstance_RawFolder");
b.HasIndex("ClusterId", "Name")
.IsUnique()
.HasDatabaseName("UX_DriverInstance_ClusterRoot_Name")
.HasFilter("[RawFolderId] IS NULL");
b.HasIndex("ClusterId", "RawFolderId", "Name")
.IsUnique()
.HasDatabaseName("UX_DriverInstance_Folder_Name")
.HasFilter("[RawFolderId] IS NOT NULL");
b.ToTable("DriverInstance", null, t =>
{
t.HasCheckConstraint("CK_DriverInstance_DriverConfig_IsJson", "ISJSON(DriverConfig) = 1");
t.HasCheckConstraint("CK_DriverInstance_ResilienceConfig_IsJson", "ResilienceConfig IS NULL OR ISJSON(ResilienceConfig) = 1");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.Equipment", b =>
{
b.Property<Guid>("EquipmentRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("AssetLocation")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("DeviceManualUri")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("EquipmentClassRef")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("EquipmentId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid>("EquipmentUuid")
.HasColumnType("uniqueidentifier");
b.Property<string>("HardwareRevision")
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("MachineCode")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Manufacturer")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ManufacturerUri")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("Model")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("SAPID")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SerialNumber")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SoftwareRevision")
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("UnsLineId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<short?>("YearOfConstruction")
.HasColumnType("smallint");
b.Property<string>("ZTag")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("EquipmentRowId");
b.HasIndex("EquipmentId")
.IsUnique()
.HasDatabaseName("UX_Equipment_LogicalId")
.HasFilter("[EquipmentId] IS NOT NULL");
b.HasIndex("EquipmentUuid")
.IsUnique()
.HasDatabaseName("UX_Equipment_Uuid");
b.HasIndex("MachineCode")
.HasDatabaseName("IX_Equipment_MachineCode");
b.HasIndex("SAPID")
.HasDatabaseName("IX_Equipment_SAPID")
.HasFilter("[SAPID] IS NOT NULL");
b.HasIndex("UnsLineId")
.HasDatabaseName("IX_Equipment_Line");
b.HasIndex("ZTag")
.HasDatabaseName("IX_Equipment_ZTag")
.HasFilter("[ZTag] IS NOT NULL");
b.HasIndex("UnsLineId", "Name")
.IsUnique()
.HasDatabaseName("UX_Equipment_LinePath");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ExternalIdReservation", b =>
{
b.Property<Guid>("ReservationId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid>("EquipmentUuid")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("FirstPublishedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("FirstPublishedBy")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Kind")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<DateTime>("LastPublishedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("ReleaseReason")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<DateTime?>("ReleasedAt")
.HasColumnType("datetime2(3)");
b.Property<string>("ReleasedBy")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("ReservationId");
b.HasIndex("EquipmentUuid")
.HasDatabaseName("IX_ExternalIdReservation_Equipment");
b.HasIndex("Kind", "Value")
.IsUnique()
.HasDatabaseName("UX_ExternalIdReservation_KindValue_Active")
.HasFilter("[ReleasedAt] IS NULL");
b.ToTable("ExternalIdReservation", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.LdapGroupRoleMapping", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ClusterId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedAtUtc")
.HasColumnType("datetime2(3)");
b.Property<bool>("IsSystemWide")
.HasColumnType("bit");
b.Property<string>("LdapGroup")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("Role")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("Id");
b.HasIndex("ClusterId");
b.HasIndex("LdapGroup")
.HasDatabaseName("IX_LdapGroupRoleMapping_Group");
b.HasIndex("LdapGroup", "ClusterId")
.IsUnique()
.HasDatabaseName("UX_LdapGroupRoleMapping_Group_Cluster");
b.ToTable("LdapGroupRoleMapping", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.NodeAcl", b =>
{
b.Property<Guid>("NodeAclRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("NodeAclId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<int>("PermissionFlags")
.HasColumnType("int");
b.Property<string>("Principal")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("ScopeId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("ScopeKind")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("NodeAclRowId");
b.HasIndex("ClusterId")
.HasDatabaseName("IX_NodeAcl_Cluster");
b.HasIndex("NodeAclId")
.IsUnique()
.HasDatabaseName("UX_NodeAcl_LogicalId")
.HasFilter("[NodeAclId] IS NOT NULL");
b.HasIndex("Principal")
.HasDatabaseName("IX_NodeAcl_Principal");
b.HasIndex("ScopeKind", "ScopeId")
.HasDatabaseName("IX_NodeAcl_Scope")
.HasFilter("[ScopeId] IS NOT NULL");
b.HasIndex("ClusterId", "Principal", "ScopeKind", "ScopeId")
.IsUnique()
.HasDatabaseName("UX_NodeAcl_PrincipalScope");
b.ToTable("NodeAcl", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.NodeDeploymentState", b =>
{
b.Property<string>("NodeId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid>("DeploymentId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("AppliedAtUtc")
.HasColumnType("datetime2(3)");
b.Property<string>("FailureReason")
.HasMaxLength(2048)
.HasColumnType("nvarchar(2048)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<DateTime>("StartedAtUtc")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("NodeId", "DeploymentId");
b.HasIndex("DeploymentId")
.HasDatabaseName("IX_NodeDeploymentState_Deployment");
b.HasIndex("Status")
.HasDatabaseName("IX_NodeDeploymentState_Status");
b.ToTable("NodeDeploymentState", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.PollGroup", b =>
{
b.Property<Guid>("PollGroupRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("DriverInstanceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("IntervalMs")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("PollGroupId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.HasKey("PollGroupRowId");
b.HasIndex("DriverInstanceId")
.HasDatabaseName("IX_PollGroup_Driver");
b.HasIndex("PollGroupId")
.IsUnique()
.HasDatabaseName("UX_PollGroup_LogicalId")
.HasFilter("[PollGroupId] IS NOT NULL");
b.ToTable("PollGroup", null, t =>
{
t.HasCheckConstraint("CK_PollGroup_IntervalMs_Min", "IntervalMs >= 50");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.RawFolder", b =>
{
b.Property<Guid>("RawFolderRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ParentRawFolderId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("RawFolderId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<int>("SortOrder")
.HasColumnType("int");
b.HasKey("RawFolderRowId");
b.HasIndex("ClusterId")
.HasDatabaseName("IX_RawFolder_Cluster");
b.HasIndex("RawFolderId")
.IsUnique()
.HasDatabaseName("UX_RawFolder_LogicalId")
.HasFilter("[RawFolderId] IS NOT NULL");
b.HasIndex("ClusterId", "Name")
.IsUnique()
.HasDatabaseName("UX_RawFolder_ClusterRoot_Name")
.HasFilter("[ParentRawFolderId] IS NULL");
b.HasIndex("ClusterId", "ParentRawFolderId", "Name")
.IsUnique()
.HasDatabaseName("UX_RawFolder_Parent_Name")
.HasFilter("[ParentRawFolderId] IS NOT NULL");
b.ToTable("RawFolder", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.RemoteNamespaceMapping", b =>
{
b.Property<Guid>("RemoteNamespaceMappingRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<int>("AllowedOperations")
.HasColumnType("int");
b.Property<string>("BranchName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("ConditionMethodTimeoutMilliseconds")
.HasColumnType("int");
b.Property<int>("ConditionSnapshotTimeoutMilliseconds")
.HasColumnType("int");
b.Property<int>("ConditionStaleTimeoutMilliseconds")
.HasColumnType("int");
b.PrimitiveCollection<string>("ConsumerNodeIds")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DataConnectionId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int?>("ExpectedArrayElementKind")
.HasColumnType("int");
b.Property<int?>("ExpectedValueKind")
.HasColumnType("int");
b.Property<string>("LocalParentId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("LocalParentKind")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<int>("MaxConditions")
.HasColumnType("int");
b.Property<int>("MaxHistoryAssemblyBytesPerRequest")
.HasColumnType("int");
b.Property<int>("MaxProjectionDepth")
.HasColumnType("int");
b.Property<int>("MaxProjectionNodes")
.HasColumnType("int");
b.Property<int>("MetadataLeaseMilliseconds")
.HasColumnType("int");
b.Property<int>("PublishingIntervalMilliseconds")
.HasColumnType("int");
b.Property<int>("Realm")
.HasColumnType("int");
b.Property<string>("RemoteIdentifier")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("RemoteIdentifierKind")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("RemoteNamespaceMappingId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("RemoteNamespaceUri")
.IsRequired()
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<int>("RemoteRealm")
.HasColumnType("int");
b.Property<string>("RemoteRootEntityId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<long>("Revision")
.HasColumnType("bigint");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<int>("SamplingIntervalMilliseconds")
.HasColumnType("int");
b.Property<int>("StaleTimeoutMilliseconds")
.HasColumnType("int");
b.Property<bool>("WriteThrough")
.HasColumnType("bit");
b.HasKey("RemoteNamespaceMappingRowId");
b.HasIndex("RemoteNamespaceMappingId")
.IsUnique()
.HasFilter("[RemoteNamespaceMappingId] IS NOT NULL");
b.HasIndex("ClusterId", "Realm", "LocalParentKind", "LocalParentId", "BranchName")
.IsUnique();
b.ToTable("RemoteNamespaceMapping", null, t =>
{
t.HasCheckConstraint("CK_RemoteNamespaceMapping_Limits", "[Revision] > 0 AND [MaxProjectionNodes] > 0 AND [MaxProjectionDepth] > 0 AND [MetadataLeaseMilliseconds] > 0 AND [StaleTimeoutMilliseconds] > 0 AND [SamplingIntervalMilliseconds] > 0 AND [PublishingIntervalMilliseconds] > 0 AND [MaxHistoryAssemblyBytesPerRequest] > 0 AND [MaxConditions] > 0 AND [ConditionStaleTimeoutMilliseconds] > 0 AND [ConditionMethodTimeoutMilliseconds] > 0 AND [ConditionSnapshotTimeoutMilliseconds] > 0");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.Script", b =>
{
b.Property<Guid>("ScriptRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("Language")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("ScriptId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SourceCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SourceHash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("ScriptRowId");
b.HasIndex("ScriptId")
.IsUnique()
.HasDatabaseName("UX_Script_LogicalId")
.HasFilter("[ScriptId] IS NOT NULL");
b.HasIndex("SourceHash")
.HasDatabaseName("IX_Script_SourceHash");
b.ToTable("Script", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ScriptedAlarm", b =>
{
b.Property<Guid>("ScriptedAlarmRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("AlarmType")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("EquipmentId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("HistorizeToAveva")
.HasColumnType("bit");
b.Property<string>("MessageTemplate")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("PredicateScriptId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("Retain")
.HasColumnType("bit");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("ScriptedAlarmId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("Severity")
.HasColumnType("int");
b.HasKey("ScriptedAlarmRowId");
b.HasIndex("PredicateScriptId")
.HasDatabaseName("IX_ScriptedAlarm_Script");
b.HasIndex("ScriptedAlarmId")
.IsUnique()
.HasDatabaseName("UX_ScriptedAlarm_LogicalId")
.HasFilter("[ScriptedAlarmId] IS NOT NULL");
b.HasIndex("EquipmentId", "Name")
.IsUnique()
.HasDatabaseName("UX_ScriptedAlarm_EquipmentPath");
b.ToTable("ScriptedAlarm", null, t =>
{
t.HasCheckConstraint("CK_ScriptedAlarm_AlarmType", "AlarmType IN ('AlarmCondition','LimitAlarm','OffNormalAlarm','DiscreteAlarm')");
t.HasCheckConstraint("CK_ScriptedAlarm_Severity_Range", "Severity BETWEEN 1 AND 1000");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", b =>
{
b.Property<string>("ClusterId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2(3)")
.HasDefaultValueSql("SYSUTCDATETIME()");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Enterprise")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<DateTime?>("ModifiedAt")
.HasColumnType("datetime2(3)");
b.Property<string>("ModifiedBy")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<byte>("NodeCount")
.HasColumnType("tinyint");
b.Property<string>("Notes")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)");
b.Property<string>("RedundancyMode")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("Site")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("ClusterId");
b.HasIndex("Name")
.IsUnique()
.HasDatabaseName("UX_ServerCluster_Name");
b.HasIndex("Site")
.HasDatabaseName("IX_ServerCluster_Site");
b.ToTable("ServerCluster", null, t =>
{
t.HasCheckConstraint("CK_ServerCluster_RedundancyMode_NodeCount", "((NodeCount = 1 AND RedundancyMode = 'None') OR (NodeCount = 2 AND RedundancyMode IN ('Warm', 'Hot')))");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.Tag", b =>
{
b.Property<Guid>("TagRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("AccessLevel")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("DeviceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("PollGroupId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("TagConfig")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("TagGroupId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("TagId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("WriteIdempotent")
.HasColumnType("bit");
b.HasKey("TagRowId");
b.HasIndex("TagId")
.IsUnique()
.HasDatabaseName("UX_Tag_LogicalId")
.HasFilter("[TagId] IS NOT NULL");
b.HasIndex("DeviceId", "Name")
.IsUnique()
.HasDatabaseName("UX_Tag_Device_Name")
.HasFilter("[TagGroupId] IS NULL");
b.HasIndex("DeviceId", "TagGroupId")
.HasDatabaseName("IX_Tag_Device");
b.HasIndex("DeviceId", "TagGroupId", "Name")
.IsUnique()
.HasDatabaseName("UX_Tag_Group_Name")
.HasFilter("[TagGroupId] IS NOT NULL");
b.ToTable("Tag", null, t =>
{
t.HasCheckConstraint("CK_Tag_TagConfig_IsJson", "ISJSON(TagConfig) = 1");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.TagGroup", b =>
{
b.Property<Guid>("TagGroupRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("DeviceId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("ParentTagGroupId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<int>("SortOrder")
.HasColumnType("int");
b.Property<string>("TagGroupId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("TagGroupRowId");
b.HasIndex("DeviceId")
.HasDatabaseName("IX_TagGroup_Device");
b.HasIndex("TagGroupId")
.IsUnique()
.HasDatabaseName("UX_TagGroup_LogicalId")
.HasFilter("[TagGroupId] IS NOT NULL");
b.HasIndex("DeviceId", "Name")
.IsUnique()
.HasDatabaseName("UX_TagGroup_DeviceRoot_Name")
.HasFilter("[ParentTagGroupId] IS NULL");
b.HasIndex("DeviceId", "ParentTagGroupId", "Name")
.IsUnique()
.HasDatabaseName("UX_TagGroup_Parent_Name")
.HasFilter("[ParentTagGroupId] IS NOT NULL");
b.ToTable("TagGroup", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.UnsArea", b =>
{
b.Property<Guid>("UnsAreaRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("ClusterId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("UnsAreaId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("UnsAreaRowId");
b.HasIndex("ClusterId")
.HasDatabaseName("IX_UnsArea_Cluster");
b.HasIndex("UnsAreaId")
.IsUnique()
.HasDatabaseName("UX_UnsArea_LogicalId")
.HasFilter("[UnsAreaId] IS NOT NULL");
b.HasIndex("ClusterId", "Name")
.IsUnique()
.HasDatabaseName("UX_UnsArea_ClusterName");
b.ToTable("UnsArea", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.UnsLine", b =>
{
b.Property<Guid>("UnsLineRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<string>("Notes")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("UnsAreaId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("UnsLineId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("UnsLineRowId");
b.HasIndex("UnsAreaId")
.HasDatabaseName("IX_UnsLine_Area");
b.HasIndex("UnsLineId")
.IsUnique()
.HasDatabaseName("UX_UnsLine_LogicalId")
.HasFilter("[UnsLineId] IS NOT NULL");
b.HasIndex("UnsAreaId", "Name")
.IsUnique()
.HasDatabaseName("UX_UnsLine_AreaName");
b.ToTable("UnsLine", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.UnsTagReference", b =>
{
b.Property<Guid>("UnsTagReferenceRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<string>("DisplayNameOverride")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("EquipmentId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<int>("SortOrder")
.HasColumnType("int");
b.Property<string>("TagId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("UnsTagReferenceId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("UnsTagReferenceRowId");
b.HasIndex("EquipmentId")
.HasDatabaseName("IX_UnsTagReference_Equipment");
b.HasIndex("TagId")
.HasDatabaseName("IX_UnsTagReference_Tag");
b.HasIndex("UnsTagReferenceId")
.IsUnique()
.HasDatabaseName("UX_UnsTagReference_LogicalId")
.HasFilter("[UnsTagReferenceId] IS NOT NULL");
b.HasIndex("EquipmentId", "TagId")
.IsUnique()
.HasDatabaseName("UX_UnsTagReference_Equip_Tag");
b.ToTable("UnsTagReference", (string)null);
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.VirtualTag", b =>
{
b.Property<Guid>("VirtualTagRowId")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier")
.HasDefaultValueSql("NEWSEQUENTIALID()");
b.Property<bool>("ChangeTriggered")
.HasColumnType("bit");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("EquipmentId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("Historize")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("rowversion");
b.Property<string>("ScriptId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int?>("TimerIntervalMs")
.HasColumnType("int");
b.Property<string>("VirtualTagId")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.HasKey("VirtualTagRowId");
b.HasIndex("ScriptId")
.HasDatabaseName("IX_VirtualTag_Script");
b.HasIndex("VirtualTagId")
.IsUnique()
.HasDatabaseName("UX_VirtualTag_LogicalId")
.HasFilter("[VirtualTagId] IS NOT NULL");
b.HasIndex("EquipmentId", "Name")
.IsUnique()
.HasDatabaseName("UX_VirtualTag_EquipmentPath");
b.ToTable("VirtualTag", null, t =>
{
t.HasCheckConstraint("CK_VirtualTag_TimerInterval_Min", "TimerIntervalMs IS NULL OR TimerIntervalMs >= 50");
t.HasCheckConstraint("CK_VirtualTag_Trigger_AtLeastOne", "ChangeTriggered = 1 OR TimerIntervalMs IS NOT NULL");
});
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNode", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", "Cluster")
.WithMany("Nodes")
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Cluster");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNodeCredential", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNode", "Node")
.WithMany("Credentials")
.HasForeignKey("NodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Node");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DataConnection", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", null)
.WithMany()
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DataExport", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", null)
.WithMany()
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.DriverInstance", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", "Cluster")
.WithMany()
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Cluster");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.LdapGroupRoleMapping", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", "Cluster")
.WithMany()
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Cluster");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.NodeDeploymentState", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.Deployment", "Deployment")
.WithMany()
.HasForeignKey("DeploymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNode", "Node")
.WithMany()
.HasForeignKey("NodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Deployment");
b.Navigation("Node");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.RawFolder", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", null)
.WithMany("RawFolders")
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.RemoteNamespaceMapping", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", null)
.WithMany()
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.UnsArea", b =>
{
b.HasOne("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", "Cluster")
.WithMany()
.HasForeignKey("ClusterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Cluster");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ClusterNode", b =>
{
b.Navigation("Credentials");
});
modelBuilder.Entity("ZB.MOM.WW.OtOpcUa.Configuration.Entities.ServerCluster", b =>
{
b.Navigation("Nodes");
b.Navigation("RawFolders");
});
#pragma warning restore 612, 618
}
}
}