修改迁移配置
This commit is contained in:
Generated
+213
@@ -0,0 +1,213 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+269
@@ -0,0 +1,269 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,105 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
|
||||
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", (string)null);
|
||||
});
|
||||
|
||||
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", (string)null);
|
||||
});
|
||||
|
||||
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", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TestNew", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -51,7 +150,7 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
|
||||
b.HasIndex("TrialImageDownloadId");
|
||||
|
||||
b.ToTable("TestNew");
|
||||
b.ToTable("TestNew", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Test.CodeFirstTest.MSSQL.TrialImageDownload", b =>
|
||||
@@ -94,7 +193,48 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TrialImageDownload");
|
||||
b.ToTable("TrialImageDownload", (string)null);
|
||||
});
|
||||
|
||||
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 =>
|
||||
@@ -106,6 +246,16 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
.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");
|
||||
|
||||
Reference in New Issue
Block a user