using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MTWorkHR.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class addCompanyIdAll : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "UserTasks",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "Teams",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "Projects",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "OrderRequests",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "OrderAllocations",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "Meetings",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<long>(
                name: "CompanyId",
                table: "Attendances",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.CreateIndex(
                name: "IX_UserTasks_CompanyId",
                table: "UserTasks",
                column: "CompanyId");

            migrationBuilder.CreateIndex(
                name: "IX_Teams_CompanyId",
                table: "Teams",
                column: "CompanyId");

            migrationBuilder.CreateIndex(
                name: "IX_Projects_CompanyId",
                table: "Projects",
                column: "CompanyId");

            migrationBuilder.CreateIndex(
                name: "IX_OrderRequests_CompanyId",
                table: "OrderRequests",
                column: "CompanyId");

            migrationBuilder.CreateIndex(
                name: "IX_OrderAllocations_CompanyId",
                table: "OrderAllocations",
                column: "CompanyId");

            migrationBuilder.CreateIndex(
                name: "IX_Meetings_CompanyId",
                table: "Meetings",
                column: "CompanyId");

            migrationBuilder.CreateIndex(
                name: "IX_Attendances_CompanyId",
                table: "Attendances",
                column: "CompanyId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_UserTasks_CompanyId",
                table: "UserTasks");

            migrationBuilder.DropIndex(
                name: "IX_Teams_CompanyId",
                table: "Teams");

            migrationBuilder.DropIndex(
                name: "IX_Projects_CompanyId",
                table: "Projects");

            migrationBuilder.DropIndex(
                name: "IX_OrderRequests_CompanyId",
                table: "OrderRequests");

            migrationBuilder.DropIndex(
                name: "IX_OrderAllocations_CompanyId",
                table: "OrderAllocations");

            migrationBuilder.DropIndex(
                name: "IX_Meetings_CompanyId",
                table: "Meetings");

            migrationBuilder.DropIndex(
                name: "IX_Attendances_CompanyId",
                table: "Attendances");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "UserTasks");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "Teams");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "Projects");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "OrderRequests");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "OrderAllocations");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "Meetings");

            migrationBuilder.DropColumn(
                name: "CompanyId",
                table: "Attendances");
        }
    }
}