重建迁移

This commit is contained in:
ChenYi 2025-07-14 11:51:28 +08:00
parent 3fdbe2bbcf
commit a5910354f2
3 changed files with 66 additions and 11 deletions

View File

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations
{
[DbContext(typeof(IoTDbContext))]
[Migration("20250708065507_InitialCreate")]
[Migration("20250714034934_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
@ -315,6 +315,9 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)")
.HasComment("集中器在物联网平台中的设备ID");
b.Property<string>("IoTPlatformProductId")
.HasColumnType("longtext");
b.Property<bool>("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<string>("FocusAddress")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("集中器地址");
b.Property<int>("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);
});

View File

@ -778,6 +778,8 @@ namespace JiShe.IoT.Migrations
IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"),
PlatformPassword = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物联网平台设备密码")
.Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformProductId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
@ -859,6 +861,8 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
MeterAddress = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "表计地址")
.Annotation("MySql:CharSet", "utf8mb4"),
FocusAddress = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "集中器地址")
.Annotation("MySql:CharSet", "utf8mb4"),
MeterType = table.Column<int>(type: "int", nullable: false, comment: "表计类型"),
Protocol = table.Column<int>(type: "int", nullable: false, comment: "协议类型"),
Baudrate = table.Column<int>(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",

View File

@ -312,6 +312,9 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)")
.HasComment("集中器在物联网平台中的设备ID");
b.Property<string>("IoTPlatformProductId")
.HasColumnType("longtext");
b.Property<bool>("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<string>("FocusAddress")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)")
.HasComment("集中器地址");
b.Property<int>("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);
});