using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

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

            migrationBuilder.CreateIndex(
                name: "IX_OrganizationEmployees_OrganizationId",
                table: "OrganizationEmployees",
                column: "OrganizationId");

            migrationBuilder.AddForeignKey(
                name: "FK_OrganizationEmployees_Organizations_OrganizationId",
                table: "OrganizationEmployees",
                column: "OrganizationId",
                principalTable: "Organizations",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_OrganizationEmployees_OrganizationId",
                table: "OrganizationEmployees");

            migrationBuilder.DropColumn(
                name: "OrganizationId",
                table: "OrganizationEmployees");
        }
    }
}
