diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250708065507_InitialCreate.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.Designer.cs similarity index 99% rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20250708065507_InitialCreate.Designer.cs rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.Designer.cs index 4f7cd75..dc15401 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250708065507_InitialCreate.Designer.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace JiShe.IoT.Migrations { [DbContext(typeof(IoTDbContext))] - [Migration("20250708065507_InitialCreate")] + [Migration("20250714034934_InitialCreate")] partial class InitialCreate { /// @@ -315,6 +315,9 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(50)") .HasComment("集中器在物联网平台中的设备ID"); + b.Property("IoTPlatformProductId") + .HasColumnType("longtext"); + b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("tinyint(1)") @@ -413,7 +416,10 @@ namespace JiShe.IoT.Migrations b.HasKey("Id"); - b.HasIndex("FocusAddress"); + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProFocusInfo_IsNotUniqueKey") + .IsDescending(); b.ToTable("ServiceProFocusInfo", (string)null); }); @@ -499,6 +505,12 @@ namespace JiShe.IoT.Migrations .HasColumnName("ExtraProperties") .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + b.Property("FocusAddress") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("集中器地址"); + b.Property("FocusId") .HasColumnType("int") .HasComment("集中器ID"); @@ -637,9 +649,14 @@ namespace JiShe.IoT.Migrations b.HasKey("Id"); + b.HasIndex("CreationTime"); + + b.HasIndex("FocusAddress"); + b.HasIndex("MeterAddress"); - b.HasIndex("MeterId"); + b.HasIndex(new[] { "Id", "MeterAddress", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProMeterInfo_IsNotUniqueKey") + .IsDescending(); b.ToTable("ServiceProMeterInfo", (string)null); }); diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250708065507_InitialCreate.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.cs similarity index 98% rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20250708065507_InitialCreate.cs rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.cs index 647dd99..4d3bf76 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250708065507_InitialCreate.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20250714034934_InitialCreate.cs @@ -778,6 +778,8 @@ namespace JiShe.IoT.Migrations IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"), PlatformPassword = table.Column(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物联网平台设备密码") .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), @@ -859,6 +861,8 @@ namespace JiShe.IoT.Migrations .Annotation("MySql:CharSet", "utf8mb4"), MeterAddress = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "表计地址") .Annotation("MySql:CharSet", "utf8mb4"), + FocusAddress = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "集中器地址") + .Annotation("MySql:CharSet", "utf8mb4"), MeterType = table.Column(type: "int", nullable: false, comment: "表计类型"), Protocol = table.Column(type: "int", nullable: false, comment: "协议类型"), Baudrate = table.Column(type: "int", nullable: false, comment: "波特率"), @@ -1550,20 +1554,37 @@ namespace JiShe.IoT.Migrations column: "UserName"); migrationBuilder.CreateIndex( - name: "IX_ServiceProFocusInfo_FocusAddress", + name: "IX_ServiceProFocusInfo_CreationTime", table: "ServiceProFocusInfo", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProFocusInfo_IsNotUniqueKey", + table: "ServiceProFocusInfo", + columns: new[] { "Id", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, + descending: new bool[0]); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProMeterInfo_CreationTime", + table: "ServiceProMeterInfo", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_ServiceProMeterInfo_FocusAddress", + table: "ServiceProMeterInfo", column: "FocusAddress"); + migrationBuilder.CreateIndex( + name: "IX_ServiceProMeterInfo_IsNotUniqueKey", + table: "ServiceProMeterInfo", + columns: new[] { "Id", "MeterAddress", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, + descending: new bool[0]); + migrationBuilder.CreateIndex( name: "IX_ServiceProMeterInfo_MeterAddress", table: "ServiceProMeterInfo", column: "MeterAddress"); - migrationBuilder.CreateIndex( - name: "IX_ServiceProMeterInfo_MeterId", - table: "ServiceProMeterInfo", - column: "MeterId"); - migrationBuilder.CreateIndex( name: "IX_ServiceProTextTemplates_Code", table: "ServiceProTextTemplates", diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs index b8ba664..4169eed 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs @@ -312,6 +312,9 @@ namespace JiShe.IoT.Migrations .HasColumnType("varchar(50)") .HasComment("集中器在物联网平台中的设备ID"); + b.Property("IoTPlatformProductId") + .HasColumnType("longtext"); + b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnType("tinyint(1)") @@ -410,7 +413,10 @@ namespace JiShe.IoT.Migrations b.HasKey("Id"); - b.HasIndex("FocusAddress"); + b.HasIndex("CreationTime"); + + b.HasIndex(new[] { "Id", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProFocusInfo_IsNotUniqueKey") + .IsDescending(); b.ToTable("ServiceProFocusInfo", (string)null); }); @@ -496,6 +502,12 @@ namespace JiShe.IoT.Migrations .HasColumnName("ExtraProperties") .HasComment("扩展属性,用于存储自定义字段,JSON格式"); + b.Property("FocusAddress") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("集中器地址"); + b.Property("FocusId") .HasColumnType("int") .HasComment("集中器ID"); @@ -634,9 +646,14 @@ namespace JiShe.IoT.Migrations b.HasKey("Id"); + b.HasIndex("CreationTime"); + + b.HasIndex("FocusAddress"); + b.HasIndex("MeterAddress"); - b.HasIndex("MeterId"); + b.HasIndex(new[] { "Id", "MeterAddress", "FocusAddress", "ProjectID", "FocusId", "CreationTime" }, "IX_ServiceProMeterInfo_IsNotUniqueKey") + .IsDescending(); b.ToTable("ServiceProMeterInfo", (string)null); });