61 lines
1.9 KiB
C#
61 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PostFundManagement.Infrastructure.Database.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddedComplianceStatusAndBeneficiaryLink : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "Status",
|
|
table: "Outcomes",
|
|
type: "integer",
|
|
nullable: false,
|
|
defaultValueSql: "1");
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "BeneficiaryId",
|
|
table: "ComplianceItems",
|
|
type: "bigint",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ComplianceItems_BeneficiaryId",
|
|
table: "ComplianceItems",
|
|
column: "BeneficiaryId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_ComplianceItems_Beneficiaries_BeneficiaryId",
|
|
table: "ComplianceItems",
|
|
column: "BeneficiaryId",
|
|
principalTable: "Beneficiaries",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_ComplianceItems_Beneficiaries_BeneficiaryId",
|
|
table: "ComplianceItems");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_ComplianceItems_BeneficiaryId",
|
|
table: "ComplianceItems");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Status",
|
|
table: "Outcomes");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "BeneficiaryId",
|
|
table: "ComplianceItems");
|
|
}
|
|
}
|
|
}
|