using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Marco.Pms.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class Added_Foreign_key_For_WorkCategery_To_WorkItem : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "WorkCategoryId",
                table: "WorkItems",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.CreateIndex(
                name: "IX_WorkItems_WorkCategoryId",
                table: "WorkItems",
                column: "WorkCategoryId");

            migrationBuilder.AddForeignKey(
                name: "FK_WorkItems_WorkCategoryMasters_WorkCategoryId",
                table: "WorkItems",
                column: "WorkCategoryId",
                principalTable: "WorkCategoryMasters",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_WorkItems_WorkCategoryId",
                table: "WorkItems");

            migrationBuilder.DropColumn(
                name: "WorkCategoryId",
                table: "WorkItems");
        }
    }
}
