using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Marco.Pms.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class Added_Project_Level_Permssion_Mapping_Table : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ProjectLevelPermissionMappings",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    EmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ProjectId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    PermissionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProjectLevelPermissionMappings", x => x.Id);
                    table.ForeignKey(
                        name: "FK_ProjectLevelPermissionMappings_Employees_EmployeeId",
                        column: x => x.EmployeeId,
                        principalTable: "Employees",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_ProjectLevelPermissionMappings_FeaturePermissions_Permission~",
                        column: x => x.PermissionId,
                        principalTable: "FeaturePermissions",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_ProjectLevelPermissionMappings_Projects_ProjectId",
                        column: x => x.ProjectId,
                        principalTable: "Projects",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_ProjectLevelPermissionMappings_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "DocumentCategoryMasters",
                keyColumn: "Id",
                keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6233));

            migrationBuilder.UpdateData(
                table: "DocumentCategoryMasters",
                keyColumn: "Id",
                keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6226));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6307));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6290));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6298));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6286));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6275));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6319));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6282));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6314));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6311));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6302));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
                column: "CreatedAt",
                value: new DateTime(2025, 9, 3, 10, 46, 49, 955, DateTimeKind.Utc).AddTicks(6295));

            migrationBuilder.CreateIndex(
                name: "IX_ProjectLevelPermissionMappings_EmployeeId",
                table: "ProjectLevelPermissionMappings",
                column: "EmployeeId");

            migrationBuilder.CreateIndex(
                name: "IX_ProjectLevelPermissionMappings_PermissionId",
                table: "ProjectLevelPermissionMappings",
                column: "PermissionId");

            migrationBuilder.CreateIndex(
                name: "IX_ProjectLevelPermissionMappings_ProjectId",
                table: "ProjectLevelPermissionMappings",
                column: "ProjectId");

            migrationBuilder.CreateIndex(
                name: "IX_ProjectLevelPermissionMappings_TenantId",
                table: "ProjectLevelPermissionMappings",
                column: "TenantId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ProjectLevelPermissionMappings");

            migrationBuilder.UpdateData(
                table: "DocumentCategoryMasters",
                keyColumn: "Id",
                keyValue: new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2627));

            migrationBuilder.UpdateData(
                table: "DocumentCategoryMasters",
                keyColumn: "Id",
                keyValue: new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2617));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("07ca7182-9ac0-4407-b988-59901170cb86"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2718));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2700));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2710));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2695));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2684));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2731));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2690));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("7cc41c91-23cb-442b-badd-f932138d149f"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2727));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2722));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2714));

            migrationBuilder.UpdateData(
                table: "DocumentTypeMasters",
                keyColumn: "Id",
                keyValue: new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"),
                column: "CreatedAt",
                value: new DateTime(2025, 8, 30, 4, 55, 10, 359, DateTimeKind.Utc).AddTicks(2705));
        }
    }
}
