using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BMA.EHR.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class updateinsigniaadddoc : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "ReliefDocId",
                table: "InsigniaPeriods",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.CreateIndex(
                name: "IX_InsigniaPeriods_ReliefDocId",
                table: "InsigniaPeriods",
                column: "ReliefDocId");

            migrationBuilder.AddForeignKey(
                name: "FK_InsigniaPeriods_Documents_ReliefDocId",
                table: "InsigniaPeriods",
                column: "ReliefDocId",
                principalTable: "Documents",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_InsigniaPeriods_ReliefDocId",
                table: "InsigniaPeriods");

            migrationBuilder.DropColumn(
                name: "ReliefDocId",
                table: "InsigniaPeriods");
        }
    }
}
