using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional namespace Marco.Pms.DataAccess.Migrations { /// public partial class Made_Status_Mapping_Nullable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~", table: "PurchaseStatusMappings"); migrationBuilder.DropForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~", table: "PurchaseStatusMappings"); migrationBuilder.DropForeignKey( name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~", table: "RequisitionStatusMappings"); migrationBuilder.AddColumn( name: "CompanyTypeId", table: "Suppliers", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci"); migrationBuilder.AlterColumn( name: "PreviousRequisitionStatusId", table: "RequisitionStatusMappings", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "PreviousPurchaseStatusId", table: "PurchaseStatusMappings", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "NextPurchaseStatusId", table: "PurchaseStatusMappings", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.InsertData( table: "ProductCategoryMasters", columns: new[] { "Id", "Description", "IsActive", "Name", "ShortName" }, values: new object[,] { { new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001"), "Materials, components, and systems used in civil and structural engineering, including concrete, steel, reinforcement, and construction accessories.", true, "Civil/Structural", "CIV" }, { new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"), "Hand tools, power tools, measuring instruments, and workshop equipment for industrial and maintenance use.", true, "Tools & Equipment", "TOO" }, { new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004"), "Mechanical components and systems such as pumps, motors, gearboxes, bearings, compressors, and power transmission equipment.", true, "Mechanical & Power Transmission", "MEC" }, { new Guid("a4ad945b-9213-4f4f-b823-b8c277871005"), "Pipes, fittings, valves, sanitary fixtures, and drainage systems used for water supply and waste management.", true, "Plumbing & Sanitary", "PLU" }, { new Guid("ac930654-b973-4d5c-b13b-06e6815c1008"), "Industrial machinery, plant equipment, forklifts, cranes, and material handling systems.", true, "Plant, Machinery & Material Handling", "PLA" }, { new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007"), "Firefighting systems, alarms, extinguishers, safety gear, and related safety infrastructure.", true, "Fire & Safety", "FIR" }, { new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"), "Cables, lighting, wiring devices, control panels, transformers, and electrical distribution systems for building and industrial use.", true, "Electrical", "ELE" }, { new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c"), "Industrial packaging materials, adhesive tapes, cleaning agents, lubricants, and operational consumables.", true, "Packaging, Consumables, Chemicals & Lubricants", "PAC" }, { new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"), "Vehicles, fleet equipment, spare parts, lubricants, and accessories for automotive applications.", true, "Automotive & Fleet", "AUT" }, { new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"), "Heating, ventilation, and air conditioning equipment including chillers, ducts, diffusers, and air handling units.", true, "HVAC", "HVA" }, { new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d"), "Cement, tiles, paints, glass, flooring, and other architectural finishing materials.", true, "Building Materials & Finishes", "BLD" }, { new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a"), "General office supplies including stationery, furniture, printers, and consumables for daily operations.", true, "Office Supplies & Stationery", "OFF" }, { new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"), "Electronic and communication products including data cabling, networking equipment, surveillance systems, and audio-visual devices.", true, "Electronics/ICT", "ICT" }, { new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b"), "Computers, servers, storage devices, network accessories, and related IT infrastructure.", true, "IT, Computing & Networking", "ITC" } }); migrationBuilder.CreateIndex( name: "IX_Suppliers_CompanyTypeId", table: "Suppliers", column: "CompanyTypeId"); migrationBuilder.AddForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~", table: "PurchaseStatusMappings", column: "NextPurchaseStatusId", principalTable: "PurchaseOrderStatus", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~", table: "PurchaseStatusMappings", column: "PreviousPurchaseStatusId", principalTable: "PurchaseOrderStatus", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~", table: "RequisitionStatusMappings", column: "PreviousRequisitionStatusId", principalTable: "RequisitionStatus", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_Suppliers_CompanyTypeMasters_CompanyTypeId", table: "Suppliers", column: "CompanyTypeId", principalTable: "CompanyTypeMasters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~", table: "PurchaseStatusMappings"); migrationBuilder.DropForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~", table: "PurchaseStatusMappings"); migrationBuilder.DropForeignKey( name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~", table: "RequisitionStatusMappings"); migrationBuilder.DropForeignKey( name: "FK_Suppliers_CompanyTypeMasters_CompanyTypeId", table: "Suppliers"); migrationBuilder.DropIndex( name: "IX_Suppliers_CompanyTypeId", table: "Suppliers"); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("a4ad945b-9213-4f4f-b823-b8c277871005")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("ac930654-b973-4d5c-b13b-06e6815c1008")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003")); migrationBuilder.DeleteData( table: "ProductCategoryMasters", keyColumn: "Id", keyValue: new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b")); migrationBuilder.DropColumn( name: "CompanyTypeId", table: "Suppliers"); migrationBuilder.AlterColumn( name: "PreviousRequisitionStatusId", table: "RequisitionStatusMappings", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "PreviousPurchaseStatusId", table: "PurchaseStatusMappings", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "NextPurchaseStatusId", table: "PurchaseStatusMappings", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AddForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~", table: "PurchaseStatusMappings", column: "NextPurchaseStatusId", principalTable: "PurchaseOrderStatus", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~", table: "PurchaseStatusMappings", column: "PreviousPurchaseStatusId", principalTable: "PurchaseOrderStatus", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~", table: "RequisitionStatusMappings", column: "PreviousRequisitionStatusId", principalTable: "RequisitionStatus", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }