This commit is contained in:
parent
054ef81c63
commit
d019ed588b
6 changed files with 1680 additions and 5 deletions
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue