using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Marco.Pms.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class Added_PaymentAdjustmentHead_ForignKey_In_ReceivedInvoicePayment_Table : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "PaymentAdjustmentHeadId",
                table: "ReceivedInvoicePayments",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("66c3c241-8b52-4327-a5ad-c1faf102583e"),
                collation: "ascii_general_ci");

            migrationBuilder.CreateIndex(
                name: "IX_ReceivedInvoicePayments_PaymentAdjustmentHeadId",
                table: "ReceivedInvoicePayments",
                column: "PaymentAdjustmentHeadId");

            migrationBuilder.AddForeignKey(
                name: "FK_ReceivedInvoicePayments_PaymentAdjustmentHeads_PaymentAdjust~",
                table: "ReceivedInvoicePayments",
                column: "PaymentAdjustmentHeadId",
                principalTable: "PaymentAdjustmentHeads",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ReceivedInvoicePayments_PaymentAdjustmentHeads_PaymentAdjust~",
                table: "ReceivedInvoicePayments");

            migrationBuilder.DropIndex(
                name: "IX_ReceivedInvoicePayments_PaymentAdjustmentHeadId",
                table: "ReceivedInvoicePayments");

            migrationBuilder.DropColumn(
                name: "PaymentAdjustmentHeadId",
                table: "ReceivedInvoicePayments");
        }
    }
}
