添加分割版本表
parent
5c29eb5860
commit
9e2cede844
|
|
@ -60,6 +60,11 @@ public class Segmentation : BaseFullDeleteAuditEntity
|
|||
[MaxLength]
|
||||
public string SEGUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小,单位字节
|
||||
/// </summary>
|
||||
public long FileSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 是否保存
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("分割文件版本")]
|
||||
[Table("SegmentationVersion")]
|
||||
public class SegmentationVersion : BaseAddAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("SegmentationId")]
|
||||
public Segmentation Segmentation { get; set; }
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 分割分组Id
|
||||
/// </summary>
|
||||
public Guid SegmentationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本号,默认为1,每次更新分割分组时版本号加1
|
||||
/// </summary>
|
||||
public int Version { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 分组的Json
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string SegmentationJson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SEG文件的URL地址
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string SEGUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小,单位字节
|
||||
/// </summary>
|
||||
public long FileSize { get; set; } = 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -371,6 +371,8 @@ public class IRaCISDBContext : DbContext
|
|||
public virtual DbSet<ReadingUserConfig> ReadingUserConfig { get; set; }
|
||||
public virtual DbSet<Segmentation> Segmentation { get; set; }
|
||||
|
||||
public virtual DbSet<SegmentationVersion> SegmentationVersion { get; set; }
|
||||
|
||||
public virtual DbSet<Segment> Segment { get; set; }
|
||||
|
||||
public virtual DbSet<SegmentBinding> SegmentBinding { get; set; }
|
||||
|
|
|
|||
22209
IRaCIS.Core.Infra.EFCore/Migrations/20260506053458_SegmentationVersion.Designer.cs
generated
Normal file
22209
IRaCIS.Core.Infra.EFCore/Migrations/20260506053458_SegmentationVersion.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SegmentationVersion : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "FileSize",
|
||||
table: "Segmentation",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SegmentationVersion",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SegmentationId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Version = table.Column<int>(type: "int", nullable: false),
|
||||
SegmentationJson = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
SEGUrl = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileSize = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SegmentationVersion", x => x.Id)
|
||||
.Annotation("SqlServer:Clustered", false);
|
||||
|
||||
},
|
||||
comment: "分割文件版本");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SegmentationVersion_CreateTime",
|
||||
table: "SegmentationVersion",
|
||||
column: "CreateTime")
|
||||
.Annotation("SqlServer:Clustered", true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Segmentation_VisitTask_VisitTaskId",
|
||||
table: "Segmentation",
|
||||
column: "VisitTaskId",
|
||||
principalTable: "VisitTask",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Segmentation_VisitTask_VisitTaskId",
|
||||
table: "Segmentation");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SegmentationVersion");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FileSize",
|
||||
table: "Segmentation");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9493,6 +9493,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Property<DateTime?>("DeletedTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("FileSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
|
|
@ -9550,6 +9553,48 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SegmentationVersion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<long>("FileSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("SEGUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("SegmentationId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("SegmentationJson")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Version")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
|
||||
|
||||
b.HasIndex("CreateTime");
|
||||
|
||||
SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
|
||||
|
||||
b.ToTable("SegmentationVersion", t =>
|
||||
{
|
||||
t.HasComment("分割文件版本");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ShortcutKey", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -19245,7 +19290,34 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
||||
.WithMany()
|
||||
.HasForeignKey("VisitTaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("VisitTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SegmentationVersion", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.Segmentation", "Segmentation")
|
||||
.WithMany()
|
||||
.HasForeignKey("SegmentationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("Segmentation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ShortcutKey", b =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue