修改上传逻辑
parent
d600862fb0
commit
df1665307a
|
@ -186,11 +186,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public long FileSize { get; set; }
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
|
||||
|
||||
public int FileCount { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -232,16 +232,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
TrialId = preArchiveStudyCommand.TrialId,
|
||||
SubjectId = preArchiveStudyCommand.SubjectId,
|
||||
SubjectVisitId = preArchiveStudyCommand.SubjectVisitId,
|
||||
|
||||
IsSuccess = false,
|
||||
UploadStartTime = DateTime.Now,
|
||||
IsDicom = true,
|
||||
IP = _userInfo.IP,
|
||||
|
||||
IsDicomReUpload = preArchiveStudyCommand.IsDicomReUpload,
|
||||
FileSize = preArchiveStudyCommand.FileSize,
|
||||
FileCount = preArchiveStudyCommand.FileCount,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -372,17 +367,20 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount == 0;
|
||||
studyMonitor.RecordPath = incommand.RecordPath;
|
||||
studyMonitor.FileSize = incommand.Study.SeriesList.SelectMany(t => t.InstanceList).Sum(t => t.FileSize);
|
||||
|
||||
var studyId = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
|
||||
var findStudy = await _taskStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
||||
|
||||
|
||||
studyMonitor.StudyId = studyId;
|
||||
studyMonitor.StudyCode = findStudy?.StudyCode ?? "";
|
||||
|
||||
studyMonitor.IsDicomReUpload = findStudy != null;
|
||||
|
||||
//上传
|
||||
if (studyMonitor.IsDicomReUpload == false)
|
||||
{
|
||||
//目前不考虑重传的问题,后面的直接覆盖前面的,全部删除
|
||||
if (_taskStudyRepository.Any(t => t.VisitTaskId == visiTaskId && t.StudyInstanceUid == incommand.Study.StudyInstanceUid))
|
||||
{
|
||||
await _taskStudyRepository.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visiTaskId);
|
||||
await _taskSeriesRepository.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visiTaskId);
|
||||
await _taskInstanceRepository.BatchDeleteNoTrackingAsync(t => t.VisitTaskId == visiTaskId);
|
||||
}
|
||||
|
||||
|
||||
var study = _mapper.Map<TaskStudy>(incommand.Study);
|
||||
|
@ -422,7 +420,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
await _taskStudyRepository.AddAsync(study);
|
||||
|
||||
|
||||
studyMonitor.StudyId = study.Id;
|
||||
studyMonitor.StudyCode = study.StudyCode;
|
||||
|
||||
|
||||
|
@ -465,18 +462,16 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
else
|
||||
{
|
||||
|
||||
var studyId = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString(), visiTaskId.ToString());
|
||||
|
||||
var study = await _taskStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
||||
|
||||
//重传的时候也要赋值检查Id
|
||||
studyMonitor.StudyId = study.Id;
|
||||
studyMonitor.StudyCode = study.StudyCode;
|
||||
studyMonitor.StudyId = findStudy.Id;
|
||||
studyMonitor.StudyCode = findStudy.StudyCode;
|
||||
|
||||
//特殊处理逻辑
|
||||
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Union(study.Modalities.Split("、", StringSplitOptions.RemoveEmptyEntries)).Distinct());
|
||||
SpecialArchiveStudyDeal(study);
|
||||
modalitys = study.Modalities;
|
||||
findStudy.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Union(findStudy.Modalities.Split("、", StringSplitOptions.RemoveEmptyEntries)).Distinct());
|
||||
SpecialArchiveStudyDeal(findStudy);
|
||||
modalitys = findStudy.Modalities;
|
||||
|
||||
|
||||
// 少了整个序列
|
||||
|
@ -494,7 +489,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
var series = _mapper.Map<TaskSeries>(seriesItem);
|
||||
|
||||
series.Id = seriesId;
|
||||
series.StudyId = study.Id;
|
||||
series.StudyId = findStudy.Id;
|
||||
|
||||
series.TrialId = incommand.TrialId;
|
||||
series.SubjectId = incommand.SubjectId;
|
||||
|
@ -505,7 +500,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
dicomSeries = await _taskSeriesRepository.AddAsync(series);
|
||||
|
||||
//新的序列 那么 检查的序列数量+1
|
||||
study.SeriesCount += 1;
|
||||
findStudy.SeriesCount += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -517,7 +512,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
{
|
||||
var insntance = _mapper.Map<TaskInstance>(instanceItem);
|
||||
insntance.Id = IdentifierHelper.CreateGuid(insntance.StudyInstanceUid, insntance.SeriesInstanceUid, insntance.SopInstanceUid, trialId.ToString(), visiTaskId.ToString());
|
||||
insntance.StudyId = study.Id;
|
||||
insntance.StudyId = findStudy.Id;
|
||||
insntance.SeriesId = dicomSeries.Id;
|
||||
|
||||
insntance.TrialId = incommand.TrialId;
|
||||
|
@ -529,7 +524,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
// 不管是新的序列 还是 该序列 掉了Instance 重传的时候 检查的instance 数量都会增加
|
||||
study.InstanceCount += seriesItem.InstanceList.Count;
|
||||
findStudy.InstanceCount += seriesItem.InstanceList.Count;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -171,6 +171,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
studyMonitor.StudyId = studyId;
|
||||
studyMonitor.StudyCode = findStudy?.StudyCode??"";
|
||||
studyMonitor.IsDicomReUpload = findStudy != null;
|
||||
|
||||
|
||||
if (incommand.Study.SeriesList.SelectMany(t => t.InstanceList).Count() == 0)
|
||||
|
@ -183,18 +184,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
//上传
|
||||
if (studyMonitor.IsDicomReUpload == false)
|
||||
{
|
||||
|
||||
//如果因为意外情况,连续点击两次,导致第一次插入了,第二次进来也会插入,在此判断一下
|
||||
if (findStudy != null)
|
||||
{
|
||||
|
||||
await _studyMonitorRepository.SaveChangesAsync();
|
||||
|
||||
//直接返回
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
var addStudy = _mapper.Map<DicomStudy>(incommand.Study);
|
||||
|
||||
var @lock = _distributedLockProvider.CreateLock($"StudyCode");
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
{
|
||||
public void Configure(EntityTypeBuilder<Dictionary> builder)
|
||||
{
|
||||
builder.HasOne(t => t.ConfigDictionary).WithMany().HasForeignKey(d => d.ConfigTypeId);
|
||||
//自身同时存在一对多 和一对一的关系,配置一对多的就可以,一对一 不用配置,有点奇怪
|
||||
builder.HasMany(t => t.ChildList).WithOne(t => t.Parent).HasForeignKey(d => d.ParentId);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Test
|
||||
{
|
||||
|
@ -21,7 +17,7 @@ namespace IRaCIS.Core.Test
|
|||
.Where(
|
||||
property => property.ClrType == typeof(string))))
|
||||
{
|
||||
property.Builder.HasMaxLength(200);
|
||||
property.Builder.HasMaxLength(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
namespace IRaCIS.Core.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// 这种方式不行
|
||||
/// </summary>
|
||||
public class NoForeignKeyConvention : IModelFinalizingConvention
|
||||
{
|
||||
public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
|
||||
{
|
||||
foreach (var entityType in modelBuilder.Metadata.GetEntityTypes())
|
||||
{
|
||||
foreach (var foreignKey in entityType.GetForeignKeys())
|
||||
{
|
||||
// 设置删除行为为 NoAction,避免生成外键约束
|
||||
foreignKey.Builder.OnDelete(DeleteBehavior.NoAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations.Operations;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations.Internal;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
|
||||
namespace IRaCIS.Core.Test
|
||||
{
|
||||
|
@ -15,16 +11,10 @@ namespace IRaCIS.Core.Test
|
|||
{
|
||||
}
|
||||
|
||||
protected override void Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
|
||||
protected override void Generate(Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
||||
{
|
||||
if (operation is AddForeignKeyOperation || operation is DropForeignKeyOperation)
|
||||
{
|
||||
// 跳过外键的生成
|
||||
return;
|
||||
}
|
||||
|
||||
base.Generate(operation, model, builder);
|
||||
operation.ForeignKeys.Clear();
|
||||
base.Generate(operation, model, builder, terminate);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +1,18 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||
{
|
||||
public class DictionaryConfigration : IEntityTypeConfiguration<Dictionary>
|
||||
{
|
||||
//public class DictionaryConfigration : IEntityTypeConfiguration<Dictionary>
|
||||
//{
|
||||
|
||||
|
||||
public void Configure(EntityTypeBuilder<Dictionary> builder)
|
||||
{
|
||||
// public void Configure(EntityTypeBuilder<Dictionary> builder)
|
||||
// {
|
||||
// //builder.HasOne(t => t.ConfigType).WithMany().HasForeignKey(d => d.ConfigTypeId);
|
||||
|
||||
// //builder.HasMany(t => t.ChildList).WithOne(t => t.Parent).HasForeignKey(d => d.ParentId);
|
||||
|
||||
builder.HasMany(t => t.ChildList).WithOne(t => t.Parent).HasForeignKey(d => d.ParentId);
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
|
|
@ -4,19 +4,19 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||
{
|
||||
public class SubjectConfigration : IEntityTypeConfiguration<Subject>
|
||||
{
|
||||
|
||||
//public class SubjectConfigration : IEntityTypeConfiguration<Subject>
|
||||
//{
|
||||
|
||||
public void Configure(EntityTypeBuilder<Subject> builder)
|
||||
{
|
||||
|
||||
//不能同时配置一对多 和一对一 但是有时表要存储多的最新的 比如受试者 最新的访视 在这里要显示配置
|
||||
builder.HasOne(s => s.LatestSubjectVisit);
|
||||
builder.HasOne(s => s.FinalSubjectVisit);
|
||||
builder.HasMany(s => s.SubejectVisitList).WithOne(sv => sv.Subject);
|
||||
}
|
||||
}
|
||||
// public void Configure(EntityTypeBuilder<Subject> builder)
|
||||
// {
|
||||
|
||||
// //不能同时配置一对多 和一对一 但是有时表要存储多的最新的 比如受试者 最新的访视 在这里要显示配置
|
||||
// builder.HasOne(s => s.LatestSubjectVisit);
|
||||
// builder.HasOne(s => s.FinalSubjectVisit);
|
||||
// builder.HasMany(s => s.SubejectVisitList).WithOne(sv => sv.Subject);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
|
||||
|
@ -20,28 +17,24 @@ public partial class IRCContext : DbContext
|
|||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<TrialImageDownload> TrialImageDownload { get; set; }
|
||||
|
||||
public virtual DbSet<TestNew> TestNew { get; set; }
|
||||
|
||||
public virtual DbSet<Subject> Subject { get; set; }
|
||||
|
||||
public virtual DbSet<SubejectVisit> SubejectVisit { get; set; }
|
||||
|
||||
public virtual DbSet<Dictionary> Dictionary { get; set; }
|
||||
public virtual DbSet<ReadingClinicalData> ReadingClinicalData { get; set; }
|
||||
public virtual DbSet<ReadModule> ReadModule { get; set; }
|
||||
|
||||
public virtual DbSet<TestStringLength> TestStringLength { get; set; }
|
||||
//public virtual DbSet<TrialImageDownload> TrialImageDownload { get; set; }
|
||||
//public virtual DbSet<TestNew> TestNew { get; set; }
|
||||
//public virtual DbSet<Subject> Subject { get; set; }
|
||||
//public virtual DbSet<SubejectVisit> SubejectVisit { get; set; }
|
||||
//public virtual DbSet<Dictionary> Dictionary { get; set; }
|
||||
//public virtual DbSet<ReadingClinicalData> ReadingClinicalData { get; set; }
|
||||
//public virtual DbSet<ReadModule> ReadModule { get; set; }
|
||||
//public virtual DbSet<TestStringLength> TestStringLength { get; set; }
|
||||
|
||||
public virtual DbSet<Project> Project { get; set; }
|
||||
|
||||
public virtual DbSet<ProjectUser> ProjectUser { get; set; }
|
||||
public virtual DbSet<ProjectUser2> ProjectUser2 { get; set; }
|
||||
|
||||
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
|
||||
// 替换默认的 MigrationsSqlGenerator
|
||||
optionsBuilder.ReplaceService<IMigrationsSqlGenerator, NoForeignKeyMigrationsSqlGenerator>();
|
||||
optionsBuilder.UseSqlServer("Server=106.14.89.110,1433;Database=IRC_Code;User ID=sa;Password=mssql_KnTs2a;TrustServerCertificate=true");
|
||||
|
@ -66,7 +59,7 @@ public partial class IRCContext : DbContext
|
|||
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
|
||||
{
|
||||
|
||||
|
||||
//configurationBuilder.Conventions.Add(_ => new NoForeignKeyConvention());
|
||||
//针对字符串使用默认的长度配置
|
||||
configurationBuilder.Conventions.Add(_ => new MaxStringLengthConvention());
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class testAdd : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TestNew",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TestName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TestNew", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TestNew");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class navigateTest : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "TrialImageDownloadId",
|
||||
table: "TestNew",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TestNew_TrialImageDownloadId",
|
||||
table: "TestNew",
|
||||
column: "TrialImageDownloadId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_TestNew_TrialImageDownload_TrialImageDownloadId",
|
||||
table: "TestNew",
|
||||
column: "TrialImageDownloadId",
|
||||
principalTable: "TrialImageDownload",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_TestNew_TrialImageDownload_TrialImageDownloadId",
|
||||
table: "TestNew");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TestNew_TrialImageDownloadId",
|
||||
table: "TestNew");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TrialImageDownloadId",
|
||||
table: "TestNew");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,213 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240910073024_oneToManyAndOneToOne")]
|
||||
partial class oneToManyAndOneToOne
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SubjectId");
|
||||
|
||||
b.ToTable("SubejectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("FinalSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LatestSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FinalSubjectVisitId");
|
||||
|
||||
b.HasIndex("LatestSubjectVisitId");
|
||||
|
||||
b.ToTable("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", "Subject")
|
||||
.WithMany("SubejectVisitList")
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "FinalSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("FinalSubjectVisitId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "LatestSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("LatestSubjectVisitId");
|
||||
|
||||
b.Navigation("FinalSubjectVisit");
|
||||
|
||||
b.Navigation("LatestSubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Navigation("SubejectVisitList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class oneToManyAndOneToOne : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SubejectVisit",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SubjectId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SubejectVisit", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Subject",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
LatestSubjectVisitId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
FinalSubjectVisitId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Subject", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Subject_SubejectVisit_FinalSubjectVisitId",
|
||||
column: x => x.FinalSubjectVisitId,
|
||||
principalTable: "SubejectVisit",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Subject_SubejectVisit_LatestSubjectVisitId",
|
||||
column: x => x.LatestSubjectVisitId,
|
||||
principalTable: "SubejectVisit",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SubejectVisit_SubjectId",
|
||||
table: "SubejectVisit",
|
||||
column: "SubjectId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Subject_FinalSubjectVisitId",
|
||||
table: "Subject",
|
||||
column: "FinalSubjectVisitId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Subject_LatestSubjectVisitId",
|
||||
table: "Subject",
|
||||
column: "LatestSubjectVisitId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_SubejectVisit_Subject_SubjectId",
|
||||
table: "SubejectVisit",
|
||||
column: "SubjectId",
|
||||
principalTable: "Subject",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SubejectVisit_Subject_SubjectId",
|
||||
table: "SubejectVisit");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Subject");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SubejectVisit");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,269 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240910075136_seftOneToManyAndOneToOne")]
|
||||
partial class seftOneToManyAndOneToOne
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("ConfigTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConfigTypeId");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.ToTable("Dictionary");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SubjectId");
|
||||
|
||||
b.ToTable("SubejectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("FinalSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LatestSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FinalSubjectVisitId");
|
||||
|
||||
b.HasIndex("LatestSubjectVisitId");
|
||||
|
||||
b.ToTable("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "ConfigType")
|
||||
.WithMany()
|
||||
.HasForeignKey("ConfigTypeId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "Parent")
|
||||
.WithMany("ChildList")
|
||||
.HasForeignKey("ParentId");
|
||||
|
||||
b.Navigation("ConfigType");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", "Subject")
|
||||
.WithMany("SubejectVisitList")
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "FinalSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("FinalSubjectVisitId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "LatestSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("LatestSubjectVisitId");
|
||||
|
||||
b.Navigation("FinalSubjectVisit");
|
||||
|
||||
b.Navigation("LatestSubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Navigation("ChildList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Navigation("SubejectVisitList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class seftOneToManyAndOneToOne : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Dictionary",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
ConfigTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Dictionary", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Dictionary_Dictionary_ConfigTypeId",
|
||||
column: x => x.ConfigTypeId,
|
||||
principalTable: "Dictionary",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Dictionary_Dictionary_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "Dictionary",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Dictionary_ConfigTypeId",
|
||||
table: "Dictionary",
|
||||
column: "ConfigTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Dictionary_ParentId",
|
||||
table: "Dictionary",
|
||||
column: "ParentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Dictionary");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,356 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240911143331_testMaxLength")]
|
||||
partial class testMaxLength
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid?>("ConfigTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConfigTypeId");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.ToTable("Dictionary");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ReadModule");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ReadingId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ReadingId");
|
||||
|
||||
b.ToTable("ReadingClinicalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SubjectId");
|
||||
|
||||
b.ToTable("SubejectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("FinalSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LatestSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FinalSubjectVisitId");
|
||||
|
||||
b.HasIndex("LatestSubjectVisitId");
|
||||
|
||||
b.ToTable("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "ConfigType")
|
||||
.WithMany()
|
||||
.HasForeignKey("ConfigTypeId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "Parent")
|
||||
.WithMany("ChildList")
|
||||
.HasForeignKey("ParentId");
|
||||
|
||||
b.Navigation("ConfigType");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", "ReadModule")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "SubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ReadModule");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", "Subject")
|
||||
.WithMany("SubejectVisitList")
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "FinalSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("FinalSubjectVisitId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "LatestSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("LatestSubjectVisitId");
|
||||
|
||||
b.Navigation("FinalSubjectVisit");
|
||||
|
||||
b.Navigation("LatestSubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Navigation("ChildList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Navigation("SubejectVisitList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,111 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class testMaxLength : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Name",
|
||||
table: "Subject",
|
||||
type: "nvarchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Code",
|
||||
table: "Dictionary",
|
||||
type: "nvarchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ReadModule",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ReadModule", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ReadingClinicalData",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Code = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
ReadingId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ReadingClinicalData", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ReadingClinicalData_ReadModule_ReadingId",
|
||||
column: x => x.ReadingId,
|
||||
principalTable: "ReadModule",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ReadingClinicalData_SubejectVisit_ReadingId",
|
||||
column: x => x.ReadingId,
|
||||
principalTable: "SubejectVisit",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ReadingClinicalData_ReadingId",
|
||||
table: "ReadingClinicalData",
|
||||
column: "ReadingId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ReadingClinicalData");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ReadModule");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Name",
|
||||
table: "Subject",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(200)",
|
||||
oldMaxLength: 200);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Code",
|
||||
table: "Dictionary",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(200)",
|
||||
oldMaxLength: 200);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,394 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240911144206_teststr")]
|
||||
partial class teststr
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid?>("ConfigTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConfigTypeId");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.ToTable("Dictionary");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ReadModule");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ReadingId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ReadingId");
|
||||
|
||||
b.ToTable("ReadingClinicalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SubjectId");
|
||||
|
||||
b.ToTable("SubejectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("FinalSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LatestSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FinalSubjectVisitId");
|
||||
|
||||
b.HasIndex("LatestSubjectVisitId");
|
||||
|
||||
b.ToTable("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestStringLength", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DefaultLength")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("UserDefineLength")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("nvarchar(300)");
|
||||
|
||||
b.Property<string>("UserDefineText")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TestStringLength");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "ConfigType")
|
||||
.WithMany()
|
||||
.HasForeignKey("ConfigTypeId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "Parent")
|
||||
.WithMany("ChildList")
|
||||
.HasForeignKey("ParentId");
|
||||
|
||||
b.Navigation("ConfigType");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", "ReadModule")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "SubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ReadModule");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", "Subject")
|
||||
.WithMany("SubejectVisitList")
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "FinalSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("FinalSubjectVisitId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "LatestSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("LatestSubjectVisitId");
|
||||
|
||||
b.Navigation("FinalSubjectVisit");
|
||||
|
||||
b.Navigation("LatestSubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Navigation("ChildList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Navigation("SubejectVisitList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,456 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240912054434_RemoveForeignKey")]
|
||||
partial class RemoveForeignKey
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid?>("ConfigTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConfigTypeId");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.ToTable("Dictionary");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ReadModule");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ReadingId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ReadingId");
|
||||
|
||||
b.ToTable("ReadingClinicalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SubjectId");
|
||||
|
||||
b.ToTable("SubejectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("FinalSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LatestSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FinalSubjectVisitId");
|
||||
|
||||
b.HasIndex("LatestSubjectVisitId");
|
||||
|
||||
b.ToTable("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestStringLength", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DefaultLength")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("UserDefineLength")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("nvarchar(300)");
|
||||
|
||||
b.Property<string>("UserDefineText")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TestStringLength");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "ConfigType")
|
||||
.WithMany()
|
||||
.HasForeignKey("ConfigTypeId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "Parent")
|
||||
.WithMany("ChildList")
|
||||
.HasForeignKey("ParentId");
|
||||
|
||||
b.Navigation("ConfigType");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", "ReadModule")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "SubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ReadModule");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", "Subject")
|
||||
.WithMany("SubejectVisitList")
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "FinalSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("FinalSubjectVisitId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "LatestSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("LatestSubjectVisitId");
|
||||
|
||||
b.Navigation("FinalSubjectVisit");
|
||||
|
||||
b.Navigation("LatestSubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Navigation("ChildList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Navigation("SubejectVisitList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240910053652_testAdd")]
|
||||
partial class testAdd
|
||||
[Migration("20240912064923_RemoveForeignKey")]
|
||||
partial class RemoveForeignKey
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
@ -25,9 +25,10 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
|
@ -36,11 +37,6 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
|
@ -49,12 +45,13 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
b.ToTable("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
|
@ -63,25 +60,7 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
|
@ -92,7 +71,20 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
|
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240910055957_navigateTest")]
|
||||
partial class navigateTest
|
||||
[Migration("20240912065315_ForeignKey")]
|
||||
partial class ForeignKey
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
@ -25,9 +25,10 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
|
@ -36,14 +37,6 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
|
@ -52,14 +45,13 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
b.ToTable("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
|
@ -68,25 +60,7 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
|
@ -97,21 +71,59 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser2", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser2");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser2", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
|
@ -6,19 +6,17 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class teststr : Migration
|
||||
public partial class ForeignKey : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TestStringLength",
|
||||
name: "ProjectUser2",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DefaultLength = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
UserDefineLength = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: false),
|
||||
UserDefineText = table.Column<string>(type: "text", maxLength: 200, nullable: false),
|
||||
ProjectId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
|
@ -26,15 +24,31 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TestStringLength", x => x.Id);
|
||||
table.PrimaryKey("PK_ProjectUser2", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ProjectUser2_Project_ProjectId",
|
||||
column: x => x.ProjectId,
|
||||
principalTable: "Project",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProjectUser2_ProjectId",
|
||||
table: "ProjectUser2",
|
||||
column: "ProjectId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "OldColumnName",
|
||||
table: "YourTableName",
|
||||
newName: "NewColumnName");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TestStringLength");
|
||||
name: "ProjectUser2");
|
||||
}
|
||||
}
|
||||
}
|
141
IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240912072724_addField.Designer.cs
generated
Normal file
141
IRaCIS.Core.Test/CodeFirstTest/MSSQL/Migrations/20240912072724_addField.Designer.cs
generated
Normal file
|
@ -0,0 +1,141 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240912072724_addField")]
|
||||
partial class addField
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser2", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser2");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser2", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addField : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Code",
|
||||
table: "ProjectUser",
|
||||
type: "nvarchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Name",
|
||||
table: "ProjectUser",
|
||||
type: "nvarchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Code",
|
||||
table: "ProjectUser");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Name",
|
||||
table: "ProjectUser");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,44 +22,6 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid?>("ConfigTypeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConfigTypeId");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
|
||||
b.ToTable("Dictionary");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
@ -80,10 +42,48 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Project");
|
||||
b.ToTable("Project", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser2", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
@ -108,264 +108,7 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("ProjectUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ReadModule");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("ReadingId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ReadingId");
|
||||
|
||||
b.ToTable("ReadingClinicalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SubjectId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SubjectId");
|
||||
|
||||
b.ToTable("SubejectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("FinalSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LatestSubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FinalSubjectVisitId");
|
||||
|
||||
b.HasIndex("LatestSubjectVisitId");
|
||||
|
||||
b.ToTable("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TestName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<Guid>("TrialImageDownloadId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestStringLength", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DefaultLength")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("UserDefineLength")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("nvarchar(300)");
|
||||
|
||||
b.Property<string>("UserDefineText")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TestStringLength");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DownloadEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DownloadStartTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ImageCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("ImageSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("ImageType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsSuccess")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("SubjectVisitId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "ConfigType")
|
||||
.WithMany()
|
||||
.HasForeignKey("ConfigTypeId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", "Parent")
|
||||
.WithMany("ChildList")
|
||||
.HasForeignKey("ParentId");
|
||||
|
||||
b.Navigation("ConfigType");
|
||||
|
||||
b.Navigation("Parent");
|
||||
b.ToTable("ProjectUser2", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser", b =>
|
||||
|
@ -379,73 +122,15 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
|||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadingClinicalData", b =>
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ProjectUser2", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.ReadModule", "ReadModule")
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Project", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "SubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReadingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ReadModule");
|
||||
|
||||
b.Navigation("SubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", "Subject")
|
||||
.WithMany("SubejectVisitList")
|
||||
.HasForeignKey("SubjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "FinalSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("FinalSubjectVisitId");
|
||||
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.SubejectVisit", "LatestSubjectVisit")
|
||||
.WithMany()
|
||||
.HasForeignKey("LatestSubjectVisitId");
|
||||
|
||||
b.Navigation("FinalSubjectVisit");
|
||||
|
||||
b.Navigation("LatestSubjectVisit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", null)
|
||||
.WithMany("TestNewList")
|
||||
.HasForeignKey("TrialImageDownloadId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Dictionary", b =>
|
||||
{
|
||||
b.Navigation("ChildList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.Subject", b =>
|
||||
{
|
||||
b.Navigation("SubejectVisitList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
{
|
||||
b.Navigation("TestNewList");
|
||||
b.Navigation("Project");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||
{
|
||||
|
@ -56,81 +53,81 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
|||
}
|
||||
|
||||
|
||||
public class Subject : BaseFullAuditEntity
|
||||
{
|
||||
public string Name { get; set; }
|
||||
//public class Subject : BaseFullAuditEntity
|
||||
//{
|
||||
// public string Name { get; set; }
|
||||
|
||||
|
||||
public Guid? LatestSubjectVisitId { get; set; }
|
||||
// public Guid? LatestSubjectVisitId { get; set; }
|
||||
|
||||
public Guid? FinalSubjectVisitId { get; set; }
|
||||
// public Guid? FinalSubjectVisitId { get; set; }
|
||||
|
||||
#region 同时配置一对多,一对一 导航属性
|
||||
// #region 同时配置一对多,一对一 导航属性
|
||||
|
||||
[ForeignKey("FinalSubjectVisitId")]
|
||||
public SubejectVisit FinalSubjectVisit { get; set; }
|
||||
// [ForeignKey("FinalSubjectVisitId")]
|
||||
// public SubejectVisit FinalSubjectVisit { get; set; }
|
||||
|
||||
[ForeignKey("LatestSubjectVisitId")]
|
||||
public SubejectVisit LatestSubjectVisit { get; set; }
|
||||
// [ForeignKey("LatestSubjectVisitId")]
|
||||
// public SubejectVisit LatestSubjectVisit { get; set; }
|
||||
|
||||
public List<SubejectVisit> SubejectVisitList { get; set; }
|
||||
#endregion
|
||||
// public List<SubejectVisit> SubejectVisitList { get; set; }
|
||||
// #endregion
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
public class SubejectVisit : BaseFullAuditEntity
|
||||
{
|
||||
public Subject Subject { get; set; }
|
||||
//public class SubejectVisit : BaseFullAuditEntity
|
||||
//{
|
||||
// public Subject Subject { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
// public Guid SubjectId { get; set; }
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
public class Dictionary : BaseFullAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
[ForeignKey("ConfigTypeId")]
|
||||
public Dictionary ConfigType { get; set; }
|
||||
//public class Dictionary : BaseFullAuditEntity
|
||||
//{
|
||||
// #region 导航属性
|
||||
// [ForeignKey("ConfigTypeId")]
|
||||
// public Dictionary ConfigType { get; set; }
|
||||
|
||||
[ForeignKey("ParentId")]
|
||||
public Dictionary Parent { get; set; }
|
||||
// [ForeignKey("ParentId")]
|
||||
// public Dictionary Parent { get; set; }
|
||||
|
||||
public List<Dictionary> ChildList { get; set; } = new List<Dictionary>();
|
||||
// public List<Dictionary> ChildList { get; set; } = new List<Dictionary>();
|
||||
|
||||
#endregion
|
||||
// #endregion
|
||||
|
||||
|
||||
public Guid? ParentId { get; set; }
|
||||
// public Guid? ParentId { get; set; }
|
||||
|
||||
|
||||
public Guid? ConfigTypeId { get; set; }
|
||||
// public Guid? ConfigTypeId { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
}
|
||||
// public string Code { get; set; }
|
||||
//}
|
||||
|
||||
#region 一个外键 关联两个实体
|
||||
public class ReadingClinicalData : BaseFullAuditEntity
|
||||
{
|
||||
public string Code { get; set; }
|
||||
//public class ReadingClinicalData : BaseFullAuditEntity
|
||||
//{
|
||||
// public string Code { get; set; }
|
||||
|
||||
|
||||
public Guid ReadingId { get; set; }
|
||||
// public Guid ReadingId { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("ReadingId")]
|
||||
// [ForeignKey("ReadingId")]
|
||||
|
||||
public SubejectVisit SubjectVisit { get; set; }
|
||||
// public SubejectVisit SubjectVisit { get; set; }
|
||||
|
||||
[ForeignKey("ReadingId")]
|
||||
// [ForeignKey("ReadingId")]
|
||||
|
||||
public ReadModule ReadModule { get; set; }
|
||||
}
|
||||
// public ReadModule ReadModule { get; set; }
|
||||
//}
|
||||
|
||||
public class ReadModule : BaseFullAuditEntity
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
//public class ReadModule : BaseFullAuditEntity
|
||||
//{
|
||||
// public string Name { get; set; }
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 测试 字符串默认长度配置
|
||||
|
@ -159,6 +156,22 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
|||
}
|
||||
|
||||
public class ProjectUser : BaseFullAuditEntity
|
||||
{
|
||||
public string Name2 { get; set; }
|
||||
|
||||
public string OtherName { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
|
||||
//外键
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
public Project Project { get; set; }
|
||||
}
|
||||
|
||||
public class ProjectUser2 : BaseFullAuditEntity
|
||||
{
|
||||
//外键
|
||||
public Guid ProjectId { get; set; }
|
||||
|
|
Loading…
Reference in New Issue