From 3fc7b72a457b81a4c1566255a0db38ccf918f5b7 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 26 Sep 2024 10:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A0=87=E6=B3=A8seqId=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=90=8E=E5=A4=84=E7=90=86=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Context/IRaCISDBContextFactory.cs | 2 +- .../EntityConfigration/ImageConfigration.cs | 138 ++++++++--------- .../20240925064340_CodeFirst_Init.Designer.cs | 145 +++++++++--------- .../20240925064340_CodeFirst_Init.cs | 104 ++++++------- .../IRaCISDBContextModelSnapshot.cs | 143 +++++++++-------- 5 files changed, 262 insertions(+), 270 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs index 515ad6a7e..904df6596 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs @@ -13,7 +13,7 @@ public class IRaCISDBContextFactory : IDesignTimeDbContextFactory(); - optionsBuilder.UseSqlServer("Server=106.14.89.110,1434;Database=Test_IRC_CodeFirst;User ID=sa;Password=xc@123456;TrustServerCertificate=true", contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure()); + optionsBuilder.UseSqlServer("Server=106.14.89.110,1434;Database=Test_IRC_KEY;User ID=sa;Password=xc@123456;TrustServerCertificate=true", contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure()); //迁移的时候,不生成外键 optionsBuilder.ReplaceService(); return new IRaCISDBContext(optionsBuilder.Options); diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs index bcd285ab1..11082e54e 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs @@ -1,81 +1,81 @@ -using IRaCIS.Core.Domain.Models; -using Microsoft.EntityFrameworkCore.Metadata.Builders; +//using IRaCIS.Core.Domain.Models; +//using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace IRaCIS.Core.Infra.EFCore.EntityConfigration; +//namespace IRaCIS.Core.Infra.EFCore.EntityConfigration; -/// -/// 医学影像 数据量大,主键是 SeqId ,Id 是自己算的,也可以作为Id,但是不是有序的,数据量大,会导致性能很差,所以是逻辑主键 -/// +///// +///// 医学影像 数据量大,主键是 SeqId ,Id 是自己算的,也可以作为Id,但是不是有序的,数据量大,会导致性能很差,所以是逻辑主键 +///// -public class DicomStudyConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class DicomStudyConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class DicomSeriesConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class DicomSeriesConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class DicomInstanceConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class DicomInstanceConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class TaskStudyConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class TaskStudyConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class TaskSeriesConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class TaskSeriesConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class TaskInstanceConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class TaskInstanceConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class SCPStudyConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class SCPStudyConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class SCPSeriesConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class SCPSeriesConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} -public class SCPInstanceConfigration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(e => e.SeqId); - } -} +//public class SCPInstanceConfigration : IEntityTypeConfiguration +//{ +// public void Configure(EntityTypeBuilder builder) +// { +// builder.HasKey(e => e.SeqId); +// } +//} diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.Designer.cs index e4480db35..d6cdd8457 100644 --- a/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.Designer.cs +++ b/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace IRaCIS.Core.Infra.EFCore.Migrations { [DbContext(typeof(IRaCISDBContext))] - [Migration("20240925064340_CodeFirst_Init")] + [Migration("20240926022902_CodeFirst_Init")] partial class CodeFirst_Init { /// @@ -780,7 +780,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomInstance", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Anonymize") @@ -808,6 +809,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(1000) .HasColumnType("nvarchar(1000)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageColumns") .HasColumnType("int"); @@ -838,9 +842,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesId") .HasColumnType("uniqueidentifier"); @@ -895,7 +896,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -911,7 +912,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AcquisitionNumber") @@ -951,6 +953,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageOrientationPatient") .IsRequired() .HasMaxLength(400) @@ -990,9 +995,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SequenceName") .IsRequired() .HasMaxLength(400) @@ -1045,7 +1047,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("VisitTaskId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -1059,8 +1061,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomStudy", b => { - b.Property("Id") - .HasColumnType("uniqueidentifier"); + b.Property("SeqId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("序列Id 避免内存移动"); b.Property("AccessionNumber") .IsRequired() @@ -1107,6 +1111,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("InstanceCount") .HasColumnType("int"); @@ -1159,10 +1166,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier") - .HasComment("序列Id 避免内存移动"); - b.Property("SeriesCount") .HasColumnType("int"); @@ -1214,7 +1217,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -3729,8 +3732,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("Content") .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasMaxLength(1200) + .HasColumnType("nvarchar(1200)"); b.Property("CreateTime") .HasColumnType("datetime2"); @@ -6914,7 +6917,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPInstance", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Anonymize") @@ -6937,6 +6941,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageColumns") .HasColumnType("int"); @@ -6967,9 +6974,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesId") .HasColumnType("uniqueidentifier"); @@ -7015,7 +7019,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -7107,7 +7111,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPSeries", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AcquisitionNumber") @@ -7147,6 +7152,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageOrientationPatient") .IsRequired() .HasMaxLength(400) @@ -7183,9 +7191,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SequenceName") .IsRequired() .HasMaxLength(400) @@ -7226,7 +7231,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("UpdateUserId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -7240,7 +7245,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudy", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AccessionNumber") @@ -7295,6 +7301,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("InstanceCount") .HasColumnType("int"); @@ -7347,9 +7356,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesCount") .HasColumnType("int"); @@ -7386,7 +7392,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("UpdateUserId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -7973,6 +7979,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.HasIndex("CreateUserId"); + b.HasIndex("SubjectId"); + b.HasIndex("TrialReadingCriterionId"); b.ToTable("SubjectCriteriaEvaluation", t => @@ -8023,12 +8031,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.HasIndex("CreateUserId"); + b.HasIndex("SubjectId"); + b.HasIndex("SubjectVisitId"); b.HasIndex("TrialReadingCriterionId"); - b.HasIndex("SubjectId", "TrialReadingCriterionId"); - b.ToTable("SubjectCriteriaEvaluationVisitFilter", t => { t.HasComment("受试者 - 附加评估标准影像筛选"); @@ -8506,13 +8514,13 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("Value") .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("ValueCN") .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.HasKey("Id"); @@ -9209,7 +9217,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskInstance", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Anonymize") @@ -9237,6 +9246,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(1000) .HasColumnType("nvarchar(1000)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageColumns") .HasColumnType("int"); @@ -9267,9 +9279,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesId") .HasColumnType("uniqueidentifier"); @@ -9324,7 +9333,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -9532,7 +9541,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskSeries", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AcquisitionNumber") @@ -9572,6 +9582,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageOrientationPatient") .IsRequired() .HasMaxLength(400) @@ -9608,9 +9621,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SequenceName") .IsRequired() .HasMaxLength(400) @@ -9660,7 +9670,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("VisitTaskId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -9674,7 +9684,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskStudy", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AccessionNumber") @@ -9722,6 +9733,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("InstanceCount") .HasColumnType("int"); @@ -9768,9 +9782,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesCount") .HasColumnType("int"); @@ -9812,7 +9823,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("VisitTaskId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -15411,14 +15422,14 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IRaCIS.Core.Domain.Models.DicomStudy", "DicomStudy") - .WithMany("DicomStudyMonitorList") + b.HasOne("IRaCIS.Core.Domain.Models.NoneDicomStudy", "NoneDicomStudy") + .WithMany() .HasForeignKey("StudyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IRaCIS.Core.Domain.Models.NoneDicomStudy", "NoneDicomStudy") - .WithMany() + b.HasOne("IRaCIS.Core.Domain.Models.DicomStudy", "DicomStudy") + .WithMany("DicomStudyMonitorList") .HasForeignKey("StudyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -15598,17 +15609,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluation", "SubjectCriteriaEvaluation") - .WithMany("SubjectCriteriaEvaluationVisitFilterList") - .HasForeignKey("SubjectId", "TrialReadingCriterionId") - .HasPrincipalKey("SubjectId", "TrialReadingCriterionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - b.Navigation("CreateUser"); - b.Navigation("SubjectCriteriaEvaluation"); - b.Navigation("SubjectVisit"); b.Navigation("TrialReadingCriterion"); @@ -17490,11 +17492,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Navigation("TaskStudyList"); }); - modelBuilder.Entity("IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluation", b => - { - b.Navigation("SubjectCriteriaEvaluationVisitFilterList"); - }); - modelBuilder.Entity("IRaCIS.Core.Domain.Models.SubjectUser", b => { b.Navigation("EarlierSubjectUserList"); diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.cs index c437aa6ec..75b891504 100644 --- a/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.cs +++ b/IRaCIS.Core.Infra.EFCore/Migrations/20240925064340_CodeFirst_Init.cs @@ -457,7 +457,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "DicomInstance", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), + SeqId = table.Column(type: "uniqueidentifier", nullable: false), Anonymize = table.Column(type: "bit", nullable: false), CPIStatus = table.Column(type: "bit", nullable: false), FileSize = table.Column(type: "bigint", nullable: true), @@ -471,7 +471,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations NumberOfFrames = table.Column(type: "int", nullable: false), Path = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), PixelSpacing = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), - SeqId = table.Column(type: "uniqueidentifier", nullable: false), SeriesId = table.Column(type: "uniqueidentifier", nullable: false), SeriesInstanceUid = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), SliceLocation = table.Column(type: "int", nullable: false), @@ -484,6 +483,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations TrialId = table.Column(type: "uniqueidentifier", nullable: false), WindowCenter = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), WindowWidth = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + Id = table.Column(type: "uniqueidentifier", nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false), UpdateUserId = table.Column(type: "uniqueidentifier", nullable: false), @@ -491,7 +491,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_DicomInstance", x => x.Id); + table.PrimaryKey("PK_DicomInstance", x => x.SeqId); }, comment: "归档 - Instance表"); @@ -499,7 +499,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "DicomSeries", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), + SeqId = table.Column(type: "uniqueidentifier", nullable: false), AcquisitionNumber = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), AcquisitionTime = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), BodyPartExamined = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), @@ -513,7 +513,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations IsReading = table.Column(type: "bit", nullable: false), Modality = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ProtocolName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), - SeqId = table.Column(type: "uniqueidentifier", nullable: false), SequenceName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), SeriesInstanceUid = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), SeriesNumber = table.Column(type: "int", nullable: false), @@ -526,6 +525,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations TrialId = table.Column(type: "uniqueidentifier", nullable: false), TriggerTime = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), VisitTaskId = table.Column(type: "uniqueidentifier", nullable: true), + Id = table.Column(type: "uniqueidentifier", nullable: false), DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedTime = table.Column(type: "datetime2", nullable: true), @@ -536,7 +536,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_DicomSeries", x => x.Id); + table.PrimaryKey("PK_DicomSeries", x => x.SeqId); }, comment: "归档 - 序列表"); @@ -544,7 +544,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "DicomStudy", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), + SeqId = table.Column(type: "uniqueidentifier", nullable: false, comment: "序列Id 避免内存移动"), AccessionNumber = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), AcquisitionNumber = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), AcquisitionTime = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), @@ -563,7 +563,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations PatientId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), PatientName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), PatientSex = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), - SeqId = table.Column(type: "uniqueidentifier", nullable: false, comment: "序列Id 避免内存移动"), SeriesCount = table.Column(type: "int", nullable: false), StudyCode = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), StudyId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false, comment: "DicomTag.StudyID"), @@ -575,6 +574,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations TriggerTime = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), UploadedTime = table.Column(type: "datetime2", nullable: true, comment: "上传时间"), Uploader = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + Id = table.Column(type: "uniqueidentifier", nullable: false), DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedTime = table.Column(type: "datetime2", nullable: true), @@ -585,7 +585,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_DicomStudy", x => x.Id); + table.PrimaryKey("PK_DicomStudy", x => x.SeqId); }); migrationBuilder.CreateTable( @@ -1829,12 +1829,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), - Value = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + Value = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), Description = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ShowOrder = table.Column(type: "int", nullable: false), Code = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ParentId = table.Column(type: "uniqueidentifier", nullable: true), - ValueCN = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + ValueCN = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), IsEnable = table.Column(type: "bit", nullable: false), BasicDataTypeEnum = table.Column(type: "int", nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), @@ -4974,7 +4974,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations ClosedTime = table.Column(type: "datetime2", nullable: true), ClosedUser = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), CloseResonEnum = table.Column(type: "int", nullable: false), - Content = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), + Content = table.Column(type: "nvarchar(1200)", maxLength: 1200, nullable: false), ActionContent = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), UserTypeEnum = table.Column(type: "int", nullable: false), ChallengeType = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), @@ -5060,7 +5060,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "FK_ReadingClinicalData_DicomStudy_StudyId", column: x => x.StudyId, principalTable: "DicomStudy", - principalColumn: "Id"); + principalColumn: "SeqId"); table.ForeignKey( name: "FK_ReadingClinicalData_Trial_TrialId", column: x => x.TrialId, @@ -5139,7 +5139,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "FK_ReadingConsistentClinicalData_DicomStudy_StudyId", column: x => x.StudyId, principalTable: "DicomStudy", - principalColumn: "Id"); + principalColumn: "SeqId"); table.ForeignKey( name: "FK_ReadingConsistentClinicalData_Trial_TrialId", column: x => x.TrialId, @@ -5393,7 +5393,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "FK_ReadingTableAnswerRowInfo_DicomInstance_InstanceId", column: x => x.InstanceId, principalTable: "DicomInstance", - principalColumn: "Id"); + principalColumn: "SeqId"); table.ForeignKey( name: "FK_ReadingTableAnswerRowInfo_OrganInfo_OrganInfoId", column: x => x.OrganInfoId, @@ -5674,7 +5674,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "SCPInstance", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), SeqId = table.Column(type: "uniqueidentifier", nullable: false), StudyId = table.Column(type: "uniqueidentifier", nullable: false), SeriesId = table.Column(type: "uniqueidentifier", nullable: false), @@ -5697,6 +5696,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations Anonymize = table.Column(type: "bit", nullable: false), Path = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), FileSize = table.Column(type: "bigint", nullable: true), + Id = table.Column(type: "uniqueidentifier", nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false), UpdateUserId = table.Column(type: "uniqueidentifier", nullable: false), @@ -5704,7 +5704,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_SCPInstance", x => x.Id); + table.PrimaryKey("PK_SCPInstance", x => x.SeqId); table.ForeignKey( name: "FK_SCPInstance_User_CreateUserId", column: x => x.CreateUserId, @@ -5763,7 +5763,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "SCPSeries", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), SeqId = table.Column(type: "uniqueidentifier", nullable: false), StudyId = table.Column(type: "uniqueidentifier", nullable: false), StudyInstanceUid = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), @@ -5785,6 +5784,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations TriggerTime = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), BodyPartForEdit = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ImageResizePath = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), + Id = table.Column(type: "uniqueidentifier", nullable: false), DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedTime = table.Column(type: "datetime2", nullable: true), @@ -5795,7 +5795,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_SCPSeries", x => x.Id); + table.PrimaryKey("PK_SCPSeries", x => x.SeqId); table.ForeignKey( name: "FK_SCPSeries_User_CreateUserId", column: x => x.CreateUserId, @@ -5809,7 +5809,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "SCPStudy", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), SeqId = table.Column(type: "uniqueidentifier", nullable: false), PatientId = table.Column(type: "uniqueidentifier", nullable: false), StudyInstanceUid = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), @@ -5838,6 +5837,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations TrialId = table.Column(type: "uniqueidentifier", nullable: false), TrialSiteId = table.Column(type: "uniqueidentifier", nullable: false), SubjectVisitId = table.Column(type: "uniqueidentifier", nullable: true), + Id = table.Column(type: "uniqueidentifier", nullable: false), DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedTime = table.Column(type: "datetime2", nullable: true), @@ -5848,7 +5848,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_SCPStudy", x => x.Id); + table.PrimaryKey("PK_SCPStudy", x => x.SeqId); table.ForeignKey( name: "FK_SCPStudy_SCPPatient_PatientId", column: x => x.PatientId, @@ -5908,7 +5908,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "FK_StudyMonitor_DicomStudy_StudyId", column: x => x.StudyId, principalTable: "DicomStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_StudyMonitor_NoneDicomStudy_StudyId", @@ -6079,7 +6079,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations constraints: table => { table.PrimaryKey("PK_SubjectCriteriaEvaluation", x => x.Id); - table.UniqueConstraint("AK_SubjectCriteriaEvaluation_SubjectId_TrialReadingCriterionId", x => new { x.SubjectId, x.TrialReadingCriterionId }); table.ForeignKey( name: "FK_SubjectCriteriaEvaluation_ReadingQuestionCriterionTrial_TrialReadingCriterionId", column: x => x.TrialReadingCriterionId, @@ -6307,12 +6306,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations principalTable: "ReadingQuestionCriterionTrial", principalColumn: "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_SubjectCriteriaEvaluationVisitFilter_SubjectCriteriaEvaluation_SubjectId_TrialReadingCriterionId", - columns: x => new { x.SubjectId, x.TrialReadingCriterionId }, - principalTable: "SubjectCriteriaEvaluation", - principalColumns: new[] { "SubjectId", "TrialReadingCriterionId" }, - onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_SubjectCriteriaEvaluationVisitFilter_SubjectVisit_SubjectVisitId", column: x => x.SubjectVisitId, @@ -6357,13 +6350,13 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomSeries_SeriesId", column: x => x.SeriesId, principalTable: "DicomSeries", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_DicomStudy_StudyId", column: x => x.StudyId, principalTable: "DicomStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_SubjectCriteriaEvaluationVisitStudyFilter_ReadingQuestionCriterionTrial_TrialReadingCriterionId", @@ -6651,7 +6644,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "TaskStudy", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), SeqId = table.Column(type: "uniqueidentifier", nullable: false), TrialId = table.Column(type: "uniqueidentifier", nullable: false), SubjectId = table.Column(type: "uniqueidentifier", nullable: false), @@ -6678,6 +6670,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations BodyPartExamined = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), BodyPartForEdit = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ModalityForEdit = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), + Id = table.Column(type: "uniqueidentifier", nullable: false), DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedTime = table.Column(type: "datetime2", nullable: true), @@ -6688,7 +6681,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_TaskStudy", x => x.Id); + table.PrimaryKey("PK_TaskStudy", x => x.SeqId); table.ForeignKey( name: "FK_TaskStudy_Subject_SubjectId", column: x => x.SubjectId, @@ -6839,11 +6832,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "TaskSeries", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), + SeqId = table.Column(type: "uniqueidentifier", nullable: false), TrialId = table.Column(type: "uniqueidentifier", nullable: false), SubjectId = table.Column(type: "uniqueidentifier", nullable: false), VisitTaskId = table.Column(type: "uniqueidentifier", nullable: false), - SeqId = table.Column(type: "uniqueidentifier", nullable: false), StudyId = table.Column(type: "uniqueidentifier", nullable: false), StudyInstanceUid = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), SeriesInstanceUid = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), @@ -6864,6 +6856,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations TriggerTime = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), BodyPartForEdit = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ImageResizePath = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), + Id = table.Column(type: "uniqueidentifier", nullable: false), DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedTime = table.Column(type: "datetime2", nullable: true), @@ -6874,12 +6867,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_TaskSeries", x => x.Id); + table.PrimaryKey("PK_TaskSeries", x => x.SeqId); table.ForeignKey( name: "FK_TaskSeries_TaskStudy_StudyId", column: x => x.StudyId, principalTable: "TaskStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_TaskSeries_User_CreateUserId", @@ -6894,7 +6887,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations name: "TaskInstance", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), SeqId = table.Column(type: "uniqueidentifier", nullable: false), StudyId = table.Column(type: "uniqueidentifier", nullable: false), SeriesId = table.Column(type: "uniqueidentifier", nullable: false), @@ -6921,6 +6913,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations Path = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), HtmlPath = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), FileSize = table.Column(type: "bigint", nullable: true), + Id = table.Column(type: "uniqueidentifier", nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false), UpdateUserId = table.Column(type: "uniqueidentifier", nullable: false), @@ -6928,18 +6921,18 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations }, constraints: table => { - table.PrimaryKey("PK_TaskInstance", x => x.Id); + table.PrimaryKey("PK_TaskInstance", x => x.SeqId); table.ForeignKey( name: "FK_TaskInstance_TaskSeries_SeriesId", column: x => x.SeriesId, principalTable: "TaskSeries", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_TaskInstance_TaskStudy_StudyId", column: x => x.StudyId, principalTable: "TaskStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_TaskInstance_User_CreateUserId", @@ -8140,6 +8133,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "SubjectCriteriaEvaluation", column: "CreateUserId"); + migrationBuilder.CreateIndex( + name: "IX_SubjectCriteriaEvaluation_SubjectId", + table: "SubjectCriteriaEvaluation", + column: "SubjectId"); + migrationBuilder.CreateIndex( name: "IX_SubjectCriteriaEvaluation_TrialReadingCriterionId", table: "SubjectCriteriaEvaluation", @@ -8151,9 +8149,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations column: "CreateUserId"); migrationBuilder.CreateIndex( - name: "IX_SubjectCriteriaEvaluationVisitFilter_SubjectId_TrialReadingCriterionId", + name: "IX_SubjectCriteriaEvaluationVisitFilter_SubjectId", table: "SubjectCriteriaEvaluationVisitFilter", - columns: new[] { "SubjectId", "TrialReadingCriterionId" }); + column: "SubjectId"); migrationBuilder.CreateIndex( name: "IX_SubjectCriteriaEvaluationVisitFilter_SubjectVisitId", @@ -9295,7 +9293,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "DicomInstance", column: "SeriesId", principalTable: "DicomSeries", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9303,7 +9301,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "DicomInstance", column: "StudyId", principalTable: "DicomStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9319,7 +9317,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "DicomSeries", column: "StudyId", principalTable: "DicomStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9636,7 +9634,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "SCPInstance", column: "SeriesId", principalTable: "SCPSeries", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9644,7 +9642,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "SCPInstance", column: "StudyId", principalTable: "SCPStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9659,7 +9657,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "SCPSeries", column: "StudyId", principalTable: "SCPStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9690,7 +9688,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations table: "StudyMonitor", column: "StudyId", principalTable: "TaskStudy", - principalColumn: "Id", + principalColumn: "SeqId", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( @@ -9979,6 +9977,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations migrationBuilder.DropTable( name: "SubjectCanceDoctor"); + migrationBuilder.DropTable( + name: "SubjectCriteriaEvaluation"); + migrationBuilder.DropTable( name: "SubjectCriteriaEvaluationVisitFilter"); @@ -10195,9 +10196,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations migrationBuilder.DropTable( name: "NoneDicomStudy"); - migrationBuilder.DropTable( - name: "SubjectCriteriaEvaluation"); - migrationBuilder.DropTable( name: "SystemDocument"); diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs b/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs index af08f6b7a..204befe2a 100644 --- a/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs +++ b/IRaCIS.Core.Infra.EFCore/Migrations/IRaCISDBContextModelSnapshot.cs @@ -777,7 +777,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomInstance", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Anonymize") @@ -805,6 +806,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(1000) .HasColumnType("nvarchar(1000)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageColumns") .HasColumnType("int"); @@ -835,9 +839,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesId") .HasColumnType("uniqueidentifier"); @@ -892,7 +893,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -908,7 +909,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AcquisitionNumber") @@ -948,6 +950,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageOrientationPatient") .IsRequired() .HasMaxLength(400) @@ -987,9 +992,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SequenceName") .IsRequired() .HasMaxLength(400) @@ -1042,7 +1044,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("VisitTaskId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -1056,8 +1058,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomStudy", b => { - b.Property("Id") - .HasColumnType("uniqueidentifier"); + b.Property("SeqId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasComment("序列Id 避免内存移动"); b.Property("AccessionNumber") .IsRequired() @@ -1104,6 +1108,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("InstanceCount") .HasColumnType("int"); @@ -1156,10 +1163,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier") - .HasComment("序列Id 避免内存移动"); - b.Property("SeriesCount") .HasColumnType("int"); @@ -1211,7 +1214,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -3726,8 +3729,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("Content") .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasMaxLength(1200) + .HasColumnType("nvarchar(1200)"); b.Property("CreateTime") .HasColumnType("datetime2"); @@ -6911,7 +6914,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPInstance", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Anonymize") @@ -6934,6 +6938,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageColumns") .HasColumnType("int"); @@ -6964,9 +6971,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesId") .HasColumnType("uniqueidentifier"); @@ -7012,7 +7016,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -7104,7 +7108,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPSeries", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AcquisitionNumber") @@ -7144,6 +7149,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageOrientationPatient") .IsRequired() .HasMaxLength(400) @@ -7180,9 +7188,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SequenceName") .IsRequired() .HasMaxLength(400) @@ -7223,7 +7228,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("UpdateUserId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -7237,7 +7242,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudy", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AccessionNumber") @@ -7292,6 +7298,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("InstanceCount") .HasColumnType("int"); @@ -7344,9 +7353,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesCount") .HasColumnType("int"); @@ -7383,7 +7389,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("UpdateUserId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -7970,6 +7976,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.HasIndex("CreateUserId"); + b.HasIndex("SubjectId"); + b.HasIndex("TrialReadingCriterionId"); b.ToTable("SubjectCriteriaEvaluation", t => @@ -8020,12 +8028,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.HasIndex("CreateUserId"); + b.HasIndex("SubjectId"); + b.HasIndex("SubjectVisitId"); b.HasIndex("TrialReadingCriterionId"); - b.HasIndex("SubjectId", "TrialReadingCriterionId"); - b.ToTable("SubjectCriteriaEvaluationVisitFilter", t => { t.HasComment("受试者 - 附加评估标准影像筛选"); @@ -8503,13 +8511,13 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("Value") .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("ValueCN") .IsRequired() - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.HasKey("Id"); @@ -9206,7 +9214,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskInstance", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Anonymize") @@ -9234,6 +9243,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(1000) .HasColumnType("nvarchar(1000)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageColumns") .HasColumnType("int"); @@ -9264,9 +9276,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesId") .HasColumnType("uniqueidentifier"); @@ -9321,7 +9330,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -9529,7 +9538,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskSeries", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AcquisitionNumber") @@ -9569,6 +9579,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("ImageOrientationPatient") .IsRequired() .HasMaxLength(400) @@ -9605,9 +9618,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SequenceName") .IsRequired() .HasMaxLength(400) @@ -9657,7 +9667,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("VisitTaskId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -9671,7 +9681,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations modelBuilder.Entity("IRaCIS.Core.Domain.Models.TaskStudy", b => { - b.Property("Id") + b.Property("SeqId") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AccessionNumber") @@ -9719,6 +9730,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); + b.Property("Id") + .HasColumnType("uniqueidentifier"); + b.Property("InstanceCount") .HasColumnType("int"); @@ -9765,9 +9779,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .HasMaxLength(400) .HasColumnType("nvarchar(400)"); - b.Property("SeqId") - .HasColumnType("uniqueidentifier"); - b.Property("SeriesCount") .HasColumnType("int"); @@ -9809,7 +9820,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Property("VisitTaskId") .HasColumnType("uniqueidentifier"); - b.HasKey("Id"); + b.HasKey("SeqId"); b.HasIndex("CreateUserId"); @@ -15408,14 +15419,14 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IRaCIS.Core.Domain.Models.DicomStudy", "DicomStudy") - .WithMany("DicomStudyMonitorList") + b.HasOne("IRaCIS.Core.Domain.Models.NoneDicomStudy", "NoneDicomStudy") + .WithMany() .HasForeignKey("StudyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IRaCIS.Core.Domain.Models.NoneDicomStudy", "NoneDicomStudy") - .WithMany() + b.HasOne("IRaCIS.Core.Domain.Models.DicomStudy", "DicomStudy") + .WithMany("DicomStudyMonitorList") .HasForeignKey("StudyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -15595,17 +15606,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluation", "SubjectCriteriaEvaluation") - .WithMany("SubjectCriteriaEvaluationVisitFilterList") - .HasForeignKey("SubjectId", "TrialReadingCriterionId") - .HasPrincipalKey("SubjectId", "TrialReadingCriterionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - b.Navigation("CreateUser"); - b.Navigation("SubjectCriteriaEvaluation"); - b.Navigation("SubjectVisit"); b.Navigation("TrialReadingCriterion"); @@ -17487,11 +17489,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations b.Navigation("TaskStudyList"); }); - modelBuilder.Entity("IRaCIS.Core.Domain.Models.SubjectCriteriaEvaluation", b => - { - b.Navigation("SubjectCriteriaEvaluationVisitFilterList"); - }); - modelBuilder.Entity("IRaCIS.Core.Domain.Models.SubjectUser", b => { b.Navigation("EarlierSubjectUserList");