fix(configdb): resync EF model snapshot to clear PendingModelChangesWarning (#32)
The actual drift was NOT OccurredAtUtc's converter (a same-CLR-type DateTime->DateTime ValueConverter emits no snapshot annotation and never triggers PendingModelChangesWarning). The real pending change was a HasData seed row: SecurityConfiguration adds LdapGroupMapping Id=5 (SCADA-Viewers -> Viewer) but the model snapshot omitted it, so MsSqlMigrationFixture's MigrateAsync threw PendingModelChangesWarning and failed every fixture-backed AuditLog MSSQL test (~57). Generated via `dotnet ef migrations add`; Up/Down are seed-data DML only (InsertData/DeleteData of the single reference row) -- no schema DDL. The snapshot now carries the Id=5 seed and has-pending-model-changes is clean.
This commit is contained in:
+1730
File diff suppressed because it is too large
Load Diff
+28
@@ -0,0 +1,28 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ResyncLdapGroupMappingSeed : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "LdapGroupMappings",
|
||||
columns: new[] { "Id", "LdapGroupName", "Role" },
|
||||
values: new object[] { 5, "SCADA-Viewers", "Viewer" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "LdapGroupMappings",
|
||||
keyColumn: "Id",
|
||||
keyValue: 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -925,6 +925,12 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
|
||||
Id = 4,
|
||||
LdapGroupName = "SCADA-Deploy-SiteA",
|
||||
Role = "Deployer"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
LdapGroupName = "SCADA-Viewers",
|
||||
Role = "Viewer"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user