using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MTWorkHR.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class altrContracyAttachs : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
                table: "ContractTaskAttachment");

            migrationBuilder.DropForeignKey(
                name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
                table: "ProjectStageAttachment");

            migrationBuilder.DropIndex(
                name: "IX_ProjectStageAttachment_AttachmentTypeId",
                table: "ProjectStageAttachment");

            migrationBuilder.DropIndex(
                name: "IX_ContractTaskAttachment_AttachmentTypeId",
                table: "ContractTaskAttachment");

            migrationBuilder.DropColumn(
                name: "Content",
                table: "ProjectStageAttachment");

            migrationBuilder.DropColumn(
                name: "Content",
                table: "ContractTaskAttachment");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<byte[]>(
                name: "Content",
                table: "ProjectStageAttachment",
                type: "varbinary(max)",
                nullable: false,
                defaultValue: new byte[0]);

            migrationBuilder.AddColumn<byte[]>(
                name: "Content",
                table: "ContractTaskAttachment",
                type: "varbinary(max)",
                nullable: false,
                defaultValue: new byte[0]);

            migrationBuilder.CreateIndex(
                name: "IX_ProjectStageAttachment_AttachmentTypeId",
                table: "ProjectStageAttachment",
                column: "AttachmentTypeId");

            migrationBuilder.CreateIndex(
                name: "IX_ContractTaskAttachment_AttachmentTypeId",
                table: "ContractTaskAttachment",
                column: "AttachmentTypeId");

            migrationBuilder.AddForeignKey(
                name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
                table: "ContractTaskAttachment",
                column: "AttachmentTypeId",
                principalTable: "AttachmentTypes",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
                table: "ProjectStageAttachment",
                column: "AttachmentTypeId",
                principalTable: "AttachmentTypes",
                principalColumn: "Id");
        }
    }
}
