This commit is contained in:
parent
054ef81c63
commit
d019ed588b
6 changed files with 1680 additions and 5 deletions
1605
Migrations/20260519102256_fix relation.Designer.cs
generated
Normal file
1605
Migrations/20260519102256_fix relation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
64
Migrations/20260519102256_fix relation.cs
Normal file
64
Migrations/20260519102256_fix relation.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Recruit.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class fixrelation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ScoreImports_Documents_ImportFileId",
|
||||
table: "ScoreImports");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "ImportFileId",
|
||||
table: "ScoreImports",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ScoreImports_Documents_ImportFileId",
|
||||
table: "ScoreImports",
|
||||
column: "ImportFileId",
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ScoreImports_Documents_ImportFileId",
|
||||
table: "ScoreImports");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "ImportFileId",
|
||||
table: "ScoreImports",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ScoreImports_Documents_ImportFileId",
|
||||
table: "ScoreImports",
|
||||
column: "ImportFileId",
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1353,7 +1353,7 @@ namespace BMA.EHR.Recruit.Migrations
|
|||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<Guid>("ImportFileId")
|
||||
b.Property<Guid?>("ImportFileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
|
|
@ -1550,9 +1550,7 @@ namespace BMA.EHR.Recruit.Migrations
|
|||
{
|
||||
b.HasOne("BMA.EHR.Recruit.Models.Documents.Document", "ImportFile")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImportFileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("ImportFileId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recruit.Models.Recruits.RecruitImport", "RecruitImport")
|
||||
.WithOne("ScoreImport")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue