using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Baya.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class RefinementPhase7SystemPayoutBatch : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_NursePayoutBatches_Users_InitiatedByAdminId",
                schema: "payouts",
                table: "NursePayoutBatches");

            migrationBuilder.AlterColumn<int>(
                name: "InitiatedByAdminId",
                schema: "payouts",
                table: "NursePayoutBatches",
                type: "int",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddForeignKey(
                name: "FK_NursePayoutBatches_Users_InitiatedByAdminId",
                schema: "payouts",
                table: "NursePayoutBatches",
                column: "InitiatedByAdminId",
                principalSchema: "usr",
                principalTable: "Users",
                principalColumn: "UserId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_NursePayoutBatches_Users_InitiatedByAdminId",
                schema: "payouts",
                table: "NursePayoutBatches");

            migrationBuilder.AlterColumn<int>(
                name: "InitiatedByAdminId",
                schema: "payouts",
                table: "NursePayoutBatches",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.AddForeignKey(
                name: "FK_NursePayoutBatches_Users_InitiatedByAdminId",
                schema: "payouts",
                table: "NursePayoutBatches",
                column: "InitiatedByAdminId",
                principalSchema: "usr",
                principalTable: "Users",
                principalColumn: "UserId",
                onDelete: ReferentialAction.Restrict);
        }
    }
}
