using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace Marco.Pms.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class Added_Document_Manager_Tables : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "DocumentTagMasters",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Description = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DocumentTagMasters", x => x.Id);
                    table.ForeignKey(
                        name: "FK_DocumentTagMasters_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "EntityTypeMasters",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Description = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EntityTypeMasters", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "DocumentCategoryMasters",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Description = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    EntityTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DocumentCategoryMasters", x => x.Id);
                    table.ForeignKey(
                        name: "FK_DocumentCategoryMasters_EntityTypeMasters_EntityTypeId",
                        column: x => x.EntityTypeId,
                        principalTable: "EntityTypeMasters",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DocumentCategoryMasters_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "DocumentTypeMasters",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RegexExpression = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    AllowedContentType = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaxSizeAllowedInMB = table.Column<double>(type: "double", nullable: false),
                    IsValidationRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    DocumentCategoryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DocumentTypeMasters", x => x.Id);
                    table.ForeignKey(
                        name: "FK_DocumentTypeMasters_DocumentCategoryMasters_DocumentCategory~",
                        column: x => x.DocumentCategoryId,
                        principalTable: "DocumentCategoryMasters",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DocumentTypeMasters_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "DocumentAttachments",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    DocumentId = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Description = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UploadedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    UploadedById = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    UpdatedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    VerifiedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    IsVerified = table.Column<bool>(type: "tinyint(1)", nullable: true),
                    VerifiedById = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    EntityId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DocumentTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DocumentAttachments", x => x.Id);
                    table.ForeignKey(
                        name: "FK_DocumentAttachments_DocumentTypeMasters_DocumentTypeId",
                        column: x => x.DocumentTypeId,
                        principalTable: "DocumentTypeMasters",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DocumentAttachments_Employees_UpdatedById",
                        column: x => x.UpdatedById,
                        principalTable: "Employees",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_DocumentAttachments_Employees_UploadedById",
                        column: x => x.UploadedById,
                        principalTable: "Employees",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DocumentAttachments_Employees_VerifiedById",
                        column: x => x.VerifiedById,
                        principalTable: "Employees",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_DocumentAttachments_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AttachmentTagMappings",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DocumentTagId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    AttachmentId = 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_AttachmentTagMappings", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AttachmentTagMappings_DocumentAttachments_AttachmentId",
                        column: x => x.AttachmentId,
                        principalTable: "DocumentAttachments",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AttachmentTagMappings_DocumentTagMasters_DocumentTagId",
                        column: x => x.DocumentTagId,
                        principalTable: "DocumentTagMasters",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AttachmentTagMappings_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AttachmentVersionMappings",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ParentAttachmentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Version = table.Column<int>(type: "int", nullable: false),
                    ChildAttachmentId = 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_AttachmentVersionMappings", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AttachmentVersionMappings_DocumentAttachments_ChildAttachmen~",
                        column: x => x.ChildAttachmentId,
                        principalTable: "DocumentAttachments",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AttachmentVersionMappings_DocumentAttachments_ParentAttachme~",
                        column: x => x.ParentAttachmentId,
                        principalTable: "DocumentAttachments",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AttachmentVersionMappings_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "DocumentAttachmentMappings",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    AttachmentId = 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_DocumentAttachmentMappings", x => x.Id);
                    table.ForeignKey(
                        name: "FK_DocumentAttachmentMappings_DocumentAttachments_AttachmentId",
                        column: x => x.AttachmentId,
                        principalTable: "DocumentAttachments",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DocumentAttachmentMappings_Documents_DocumentId",
                        column: x => x.DocumentId,
                        principalTable: "Documents",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DocumentAttachmentMappings_Tenants_TenantId",
                        column: x => x.TenantId,
                        principalTable: "Tenants",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.InsertData(
                table: "EntityTypeMasters",
                columns: new[] { "Id", "Description", "Name" },
                values: new object[,]
                {
                    { new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"), "Emtities related to project.", "Project Entity" },
                    { new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"), "Employee related entitie", "Employee Entity" }
                });

            migrationBuilder.InsertData(
                table: "Features",
                columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
                values: new object[] { new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), "Manage Document", true, new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), "Document Management" });

            migrationBuilder.InsertData(
                table: "DocumentCategoryMasters",
                columns: new[] { "Id", "CreatedAt", "Description", "EntityTypeId", "Name", "TenantId" },
                values: new object[,]
                {
                    { new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8157), "Employment details along with legal IDs like passports or driver’s licenses to verify identity and work authorization.", new Guid("dbb9555a-7a0c-40f2-a9ed-f0463f1ceed7"), "Employee Documents", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8150), "Project documents are formal records that outline the plans, progress, and details necessary to execute and manage a project effectively.", new Guid("c8fe7115-aa27-43bc-99f4-7b05fabe436e"), "Project Documents", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
                });

            migrationBuilder.InsertData(
                table: "FeaturePermissions",
                columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
                values: new object[,]
                {
                    { new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"), "Grants a user the authority to verify the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Verify Document" },
                    { new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"), "Grants a user the authority to upload the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Upload Document" },
                    { new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"), "Grants a user the authority to delete the document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Delete Document" },
                    { new Guid("71189504-f1c8-4ca5-8db6-810497be2854"), "Grants a user the authority to view all documents related to employees and projects", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "View Document" },
                    { new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"), "Grants a user the authority to modify document", new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"), true, "Mofify Document" }
                });

            migrationBuilder.InsertData(
                table: "DocumentTypeMasters",
                columns: new[] { "Id", "AllowedContentType", "CreatedAt", "DocumentCategoryId", "IsActive", "IsMandatory", "IsSystem", "IsValidationRequired", "MaxSizeAllowedInMB", "Name", "RegexExpression", "TenantId" },
                values: new object[,]
                {
                    { new Guid("07ca7182-9ac0-4407-b988-59901170cb86"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8229), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Letter of Agreement", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("16c40b80-c207-4a0c-a4d3-381414afe35a"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8216), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Passport", "^[A-PR-WY][1-9]\\d\\s?\\d{4}[1-9]$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("260abd7e-c96d-4ae4-a29b-9b5bb5d24ebd"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8222), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Bill of Quantities (BOQ)", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("2d1d7441-46a8-425e-9395-94d0956f8e91"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8212), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Voter Card", "^[A-Z]{3}[0-9]{7}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("336225ac-67f3-4e14-ba7a-8fad03cf2832"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8204), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Aadhaar card", "^[2-9][0-9]{11}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("5668de00-5d84-47f7-b9b5-7fefd1219f05"), "application/pdf,image/vnd.dwg,application/acad", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8238), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 20.0, "Drawings", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("6344393b-9bb1-45f8-b620-9f6e279d012c"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8209), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Pan Card", "^[A-Z]{5}[0-9]{4}[A-Z]{1}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("7cc41c91-23cb-442b-badd-f932138d149f"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8235), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Standard Operating Procedure (SOP)", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("846e89a9-5735-45ec-a21d-c97f85a94ada"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8232), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Health and Safety Document", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("a1a190ba-c4a8-432f-b26d-1231ca1d44bc"), "application/pdf,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8226), new Guid("cfbff269-072b-477a-b48b-72cdc57dd1d3"), true, false, true, false, 1.0, "Work Order", null, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
                    { new Guid("f76d8215-d399-4f0e-b414-12e427f50be3"), "application/pdf", new DateTime(2025, 8, 28, 5, 50, 2, 39, DateTimeKind.Utc).AddTicks(8219), new Guid("2d9fb9cf-db53-476b-a452-492e88e2b51f"), true, true, true, true, 2.0, "Bank Passbook", "^\\d{9,18}$", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
                });

            migrationBuilder.CreateIndex(
                name: "IX_AttachmentTagMappings_AttachmentId",
                table: "AttachmentTagMappings",
                column: "AttachmentId");

            migrationBuilder.CreateIndex(
                name: "IX_AttachmentTagMappings_DocumentTagId",
                table: "AttachmentTagMappings",
                column: "DocumentTagId");

            migrationBuilder.CreateIndex(
                name: "IX_AttachmentTagMappings_TenantId",
                table: "AttachmentTagMappings",
                column: "TenantId");

            migrationBuilder.CreateIndex(
                name: "IX_AttachmentVersionMappings_ChildAttachmentId",
                table: "AttachmentVersionMappings",
                column: "ChildAttachmentId");

            migrationBuilder.CreateIndex(
                name: "IX_AttachmentVersionMappings_ParentAttachmentId",
                table: "AttachmentVersionMappings",
                column: "ParentAttachmentId");

            migrationBuilder.CreateIndex(
                name: "IX_AttachmentVersionMappings_TenantId",
                table: "AttachmentVersionMappings",
                column: "TenantId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachmentMappings_AttachmentId",
                table: "DocumentAttachmentMappings",
                column: "AttachmentId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachmentMappings_DocumentId",
                table: "DocumentAttachmentMappings",
                column: "DocumentId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachmentMappings_TenantId",
                table: "DocumentAttachmentMappings",
                column: "TenantId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachments_DocumentTypeId",
                table: "DocumentAttachments",
                column: "DocumentTypeId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachments_TenantId",
                table: "DocumentAttachments",
                column: "TenantId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachments_UpdatedById",
                table: "DocumentAttachments",
                column: "UpdatedById");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachments_UploadedById",
                table: "DocumentAttachments",
                column: "UploadedById");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentAttachments_VerifiedById",
                table: "DocumentAttachments",
                column: "VerifiedById");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentCategoryMasters_EntityTypeId",
                table: "DocumentCategoryMasters",
                column: "EntityTypeId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentCategoryMasters_TenantId",
                table: "DocumentCategoryMasters",
                column: "TenantId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentTagMasters_TenantId",
                table: "DocumentTagMasters",
                column: "TenantId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentTypeMasters_DocumentCategoryId",
                table: "DocumentTypeMasters",
                column: "DocumentCategoryId");

            migrationBuilder.CreateIndex(
                name: "IX_DocumentTypeMasters_TenantId",
                table: "DocumentTypeMasters",
                column: "TenantId");
        }

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

            migrationBuilder.DropTable(
                name: "AttachmentVersionMappings");

            migrationBuilder.DropTable(
                name: "DocumentAttachmentMappings");

            migrationBuilder.DropTable(
                name: "DocumentTagMasters");

            migrationBuilder.DropTable(
                name: "DocumentAttachments");

            migrationBuilder.DropTable(
                name: "DocumentTypeMasters");

            migrationBuilder.DropTable(
                name: "DocumentCategoryMasters");

            migrationBuilder.DropTable(
                name: "EntityTypeMasters");

            migrationBuilder.DeleteData(
                table: "FeaturePermissions",
                keyColumn: "Id",
                keyValue: new Guid("13a1f30f-38d1-41bf-8e7a-b75189aab8e0"));

            migrationBuilder.DeleteData(
                table: "FeaturePermissions",
                keyColumn: "Id",
                keyValue: new Guid("3f6d1f67-6fa5-4b7c-b17b-018d4fe4aab8"));

            migrationBuilder.DeleteData(
                table: "FeaturePermissions",
                keyColumn: "Id",
                keyValue: new Guid("40863a13-5a66-469d-9b48-135bc5dbf486"));

            migrationBuilder.DeleteData(
                table: "FeaturePermissions",
                keyColumn: "Id",
                keyValue: new Guid("71189504-f1c8-4ca5-8db6-810497be2854"));

            migrationBuilder.DeleteData(
                table: "FeaturePermissions",
                keyColumn: "Id",
                keyValue: new Guid("c423fd81-6273-4b9d-bb5e-76a0fb343833"));

            migrationBuilder.DeleteData(
                table: "Features",
                keyColumn: "Id",
                keyValue: new Guid("a8cf4331-8f04-4961-8360-a3f7c3cc7462"));
        }
    }
}
