中心调研增加上传文件

This commit is contained in:
2026-07-01 11:33:11 +08:00
parent 826aff3d36
commit e1ee129f41
11 changed files with 22624 additions and 17 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,73 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class addfile : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "CommonUploadRecordId",
table: "TrialSiteSurvey",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateTable(
name: "CommonUploadRecord",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
FileType = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false, comment: "文件类型"),
FileName = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
FileSize = table.Column<long>(type: "bigint", nullable: false),
Path = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CommonUploadRecord", x => x.Id)
.Annotation("SqlServer:Clustered", false);
table.ForeignKey(
name: "FK_CommonUploadRecord_User_CreateUserId",
column: x => x.CreateUserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
//migrationBuilder.CreateIndex(
// name: "IX_CommonUploadRecord_CreateTime",
// table: "CommonUploadRecord",
// column: "CreateTime")
// .Annotation("SqlServer:Clustered", true);
//migrationBuilder.AddForeignKey(
// name: "FK_TrialSiteSurvey_CommonUploadRecord_CommonUploadRecordId",
// table: "TrialSiteSurvey",
// column: "CommonUploadRecordId",
// principalTable: "CommonUploadRecord",
// principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TrialSiteSurvey_CommonUploadRecord_CommonUploadRecordId",
table: "TrialSiteSurvey");
migrationBuilder.DropTable(
name: "CommonUploadRecord");
migrationBuilder.DropColumn(
name: "CommonUploadRecordId",
table: "TrialSiteSurvey");
}
}
}
@@ -825,6 +825,47 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
});
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonUploadRecord", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime2");
b.Property<Guid>("CreateUserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("FileName")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<long>("FileSize")
.HasColumnType("bigint");
b.Property<string>("FileType")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)")
.HasComment("文件类型");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.HasKey("Id");
SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
b.HasIndex("CreateTime");
SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("CreateTime"));
b.ToTable("CommonUploadRecord");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionKeyFileRead", b =>
{
b.Property<Guid>("Id")
@@ -15151,6 +15192,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<int>("AverageEngravingCycle")
.HasColumnType("int");
b.Property<Guid?>("CommonUploadRecordId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime2");
@@ -17303,6 +17347,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Navigation("CreateUserRole");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonUploadRecord", b =>
{
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
.WithMany()
.HasForeignKey("CreateUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreateUserRole");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionKeyFileRead", b =>
{
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
@@ -21224,6 +21279,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialSiteSurvey", b =>
{
b.HasOne("IRaCIS.Core.Domain.Models.CommonUploadRecord", "SiteSurveyFile")
.WithMany()
.HasForeignKey("CommonUploadRecordId");
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
.WithMany()
.HasForeignKey("CreateUserId")
@@ -21256,6 +21315,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Navigation("ReviewerUser");
b.Navigation("SiteSurveyFile");
b.Navigation("Trial");
b.Navigation("TrialSite");