76 lines
2.5 KiB
C#
76 lines
2.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class addGroupAE : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
|
table: "SCPStudyHospitalGroup");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "CallingAE",
|
|
table: "HospitalGroup",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
defaultValue: "");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Trial_HospitalGroupId",
|
|
table: "Trial",
|
|
column: "HospitalGroupId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
|
table: "SCPStudyHospitalGroup",
|
|
column: "SCPStudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Trial_HospitalGroup_HospitalGroupId",
|
|
table: "Trial",
|
|
column: "HospitalGroupId",
|
|
principalTable: "HospitalGroup",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
|
table: "SCPStudyHospitalGroup");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Trial_HospitalGroup_HospitalGroupId",
|
|
table: "Trial");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Trial_HospitalGroupId",
|
|
table: "Trial");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CallingAE",
|
|
table: "HospitalGroup");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
|
table: "SCPStudyHospitalGroup",
|
|
column: "SCPStudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "SeqId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|