52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace BMA.EHR.Recruit.Service.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UpdateRecruitScoreRelationship : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "ScoreImportId",
|
|
table: "RecruitImports",
|
|
type: "char(36)",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
collation: "ascii_general_ci");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_RecruitImports_ScoreImportId",
|
|
table: "RecruitImports",
|
|
column: "ScoreImportId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_RecruitImports_ScoreImports_ScoreImportId",
|
|
table: "RecruitImports",
|
|
column: "ScoreImportId",
|
|
principalTable: "ScoreImports",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_RecruitImports_ScoreImports_ScoreImportId",
|
|
table: "RecruitImports");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_RecruitImports_ScoreImportId",
|
|
table: "RecruitImports");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ScoreImportId",
|
|
table: "RecruitImports");
|
|
}
|
|
}
|
|
}
|