From cb33f8d08be7fc200864d0bf8cb6c6b08e051121 Mon Sep 17 00:00:00 2001 From: wzh425 Date: Wed, 7 Jan 2026 15:45:59 +0800 Subject: [PATCH] fix: Update AlarmRuleConfiguration to prevent unintended value generation for Show property Modified the Show property in AlarmRuleConfiguration to use ValueGeneratedNever(), ensuring that its value is explicitly set and not generated by the database. --- .../EntityTypeConfigurations/AlarmRuleConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Infrastructure/Masa.Alert.EntityFrameworkCore/EntityTypeConfigurations/AlarmRuleConfiguration.cs b/src/Infrastructure/Masa.Alert.EntityFrameworkCore/EntityTypeConfigurations/AlarmRuleConfiguration.cs index 04f1c5f7..6c2f0980 100644 --- a/src/Infrastructure/Masa.Alert.EntityFrameworkCore/EntityTypeConfigurations/AlarmRuleConfiguration.cs +++ b/src/Infrastructure/Masa.Alert.EntityFrameworkCore/EntityTypeConfigurations/AlarmRuleConfiguration.cs @@ -14,7 +14,7 @@ public void Configure(EntityTypeBuilder builder) builder.Property(x => x.ChartYAxisUnit).HasMaxLength(128); builder.Property(x => x.TotalVariable).HasMaxLength(64); builder.Property(x => x.Source).IsRequired().HasMaxLength(40).HasDefaultValue(string.Empty); - builder.Property(x => x.Show).HasDefaultValue(true).IsRequired(); + builder.Property(x => x.Show).HasDefaultValue(true).IsRequired().ValueGeneratedNever(); builder.OwnsMany(x => x.LogMonitorItems, b => { b.ToTable(AlertConsts.DB_TABLE_PREFIX + "AlarmRuleLogMonitors", AlertConsts.DB_SCHEMA);