优化子设备表设计

This commit is contained in:
ChenYi 2026-01-20 11:42:42 +08:00
parent 38cf8f6f1a
commit 089faa9842
4 changed files with 4365 additions and 12 deletions

View File

@ -883,9 +883,7 @@ namespace JiShe.IoT.DeviceAggregation
}
}
//处理子设备
//暂不考虑子设备地址信息,由网关设备主动上报
return true;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JiShe.IoT.Migrations
{
/// <inheritdoc />
public partial class updatetable202601201031 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BusinessSystemSubDeviceDataId",
table: "ServiceProSubDeviceManagementInfo");
migrationBuilder.DropColumn(
name: "BusinessSystemDeviceDataId",
table: "ServiceProDeviceInfo");
migrationBuilder.AlterTable(
name: "ServiceProSubDeviceManagementInfo",
comment: "子设备信息,需要下发配置的网关设备才用到",
oldComment: "子设备信息");
migrationBuilder.AddColumn<bool>(
name: "IsSynced",
table: "ServiceProSubDeviceManagementInfo",
type: "boolean",
nullable: false,
defaultValue: false,
comment: "是否同步");
migrationBuilder.AddColumn<int>(
name: "SubDeviceCapacity",
table: "ServiceProDeviceInfo",
type: "integer",
nullable: false,
defaultValue: 64,
comment: "子设备容量");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsSynced",
table: "ServiceProSubDeviceManagementInfo");
migrationBuilder.DropColumn(
name: "SubDeviceCapacity",
table: "ServiceProDeviceInfo");
migrationBuilder.AlterTable(
name: "ServiceProSubDeviceManagementInfo",
comment: "子设备信息",
oldComment: "子设备信息,需要下发配置的网关设备才用到");
migrationBuilder.AddColumn<long>(
name: "BusinessSystemSubDeviceDataId",
table: "ServiceProSubDeviceManagementInfo",
type: "bigint",
nullable: true,
comment: "业务系统子设备数据Id");
migrationBuilder.AddColumn<long>(
name: "BusinessSystemDeviceDataId",
table: "ServiceProDeviceInfo",
type: "bigint",
nullable: true,
comment: "业务系统设备数据Id");
}
}
}

View File

@ -695,10 +695,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("character varying(50)")
.HasComment("账户手机号");
b.Property<long?>("BusinessSystemDeviceDataId")
.HasColumnType("bigint")
.HasComment("业务系统设备数据Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
@ -844,6 +840,12 @@ namespace JiShe.IoT.Migrations
.HasColumnType("text")
.HasComment("备注");
b.Property<int>("SubDeviceCapacity")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(64)
.HasComment("子设备容量");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId")
@ -1021,10 +1023,6 @@ namespace JiShe.IoT.Migrations
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<long?>("BusinessSystemSubDeviceDataId")
.HasColumnType("bigint")
.HasComment("业务系统子设备数据Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
@ -1069,6 +1067,10 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsSynced")
.HasColumnType("boolean")
.HasComment("是否同步");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("LastModificationTime");
@ -1135,7 +1137,7 @@ namespace JiShe.IoT.Migrations
b.ToTable("ServiceProSubDeviceManagementInfo", null, t =>
{
t.HasComment("子设备信息");
t.HasComment("子设备信息,需要下发配置的网关设备才用到");
});
});