using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Distribution.Migrations { /// public partial class AddSupplierPayments : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "CompanyId", table: "ReceivedCheques", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddColumn( name: "FK_BankAccountId", table: "Payments", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AddColumn( name: "FK_ReceivedChequeId", table: "Payments", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.CreateTable( name: "SupplierPayments", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FK_SupplierId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Amount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), Method = table.Column(type: "int", nullable: false), FK_BankAccountId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), FK_ChequePageId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), PaidAt = table.Column(type: "datetime(6)", nullable: false), PaidByUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Notes = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedAt = table.Column(type: "datetime(6)", nullable: false), IsActive = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SupplierPayments", x => x.Id); table.ForeignKey( name: "FK_SupplierPayments_BankAccounts_FK_BankAccountId", column: x => x.FK_BankAccountId, principalTable: "BankAccounts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_SupplierPayments_ChequePages_FK_ChequePageId", column: x => x.FK_ChequePageId, principalTable: "ChequePages", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_SupplierPayments_Suppliers_FK_SupplierId", column: x => x.FK_SupplierId, principalTable: "Suppliers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "SupplierPaymentGRNs", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FK_SupplierPaymentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FK_GoodsReceiptId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), AllocatedAmount = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), CreatedAt = table.Column(type: "datetime(6)", nullable: false), IsActive = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SupplierPaymentGRNs", x => x.Id); table.ForeignKey( name: "FK_SupplierPaymentGRNs_GoodsReceipts_FK_GoodsReceiptId", column: x => x.FK_GoodsReceiptId, principalTable: "GoodsReceipts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_SupplierPaymentGRNs_SupplierPayments_FK_SupplierPaymentId", column: x => x.FK_SupplierPaymentId, principalTable: "SupplierPayments", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Payments", keyColumn: "Id", keyValue: new Guid("47000000-0000-0000-0000-000000000001"), columns: new[] { "FK_BankAccountId", "FK_ReceivedChequeId" }, values: new object[] { null, null }); migrationBuilder.UpdateData( table: "Payments", keyColumn: "Id", keyValue: new Guid("47000000-0000-0000-0000-000000000002"), columns: new[] { "FK_BankAccountId", "FK_ReceivedChequeId" }, values: new object[] { null, null }); migrationBuilder.UpdateData( table: "Payments", keyColumn: "Id", keyValue: new Guid("47000000-0000-0000-0000-000000000003"), columns: new[] { "FK_BankAccountId", "FK_ReceivedChequeId" }, values: new object[] { null, null }); migrationBuilder.UpdateData( table: "Payments", keyColumn: "Id", keyValue: new Guid("47000000-0000-0000-0000-000000000004"), columns: new[] { "FK_BankAccountId", "FK_ReceivedChequeId" }, values: new object[] { null, null }); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000001"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("30f658ac-2c92-4cd8-ad47-10b0def2699c")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000002"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("42ab2c52-eaf8-4a17-b67a-ccd66569e56a")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000003"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("8afec825-27b3-4153-ad06-f8bcdbf93da8")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000004"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("4b427620-e99d-4068-a416-c3788d5bd9b5")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000005"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("361f44ef-1cd1-48a9-be4d-4c068aacef1e")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000006"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("11fc03ae-92ee-4336-ae57-29aac731ad51")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000007"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("0b1f2b73-ef60-4634-864f-22a6c0cd1373")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000008"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("2380abf3-2bcd-4a9f-b447-5f1685df2fc8")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000009"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("240e4d6a-8306-40ba-aaec-8e05cd0347db")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000010"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("cfde0aa6-e859-4f9c-8291-b0d886fcd4c9")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000011"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("dae772c8-26ec-4b5c-8d7a-f3196510bf2c")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000012"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("3512c0a4-a5ae-4002-a779-7d3cc600ab61")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000013"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("f9e2a348-159e-47a2-b7be-a60f0254873f")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000014"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("c8b4c181-5b08-45d2-818b-74bceeab78a8")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000015"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("8fb4ff4c-c5bd-4afd-a08e-02861d63cb7b")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000016"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("edb3b711-d623-439d-811e-afaef8d0680d")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000017"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("f33e4c62-d69f-4a91-8b62-acbd5351ea2a")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000018"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("c7c9d16c-e343-43e9-9e27-f38f903a5d00")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000019"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("f5f4760a-8a45-46ca-8093-743c95b0313f")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000020"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("c5434801-146a-4fd9-9c29-a1145e7f7f00")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000021"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("6c085135-78a5-4e65-a380-ee090b07e2bb")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000022"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("bbde2785-a3df-4f81-bad1-0bc5afe5de57")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000023"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("4421a0fb-bdd4-45a9-8dc0-d9b70f775e97")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000024"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("dba9dcb4-3b94-4ddc-89f3-552cfc109478")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000025"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("d8f74160-c150-4d9c-aba6-e45e628c684e")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000026"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("495fb68b-9f01-4538-9561-fefce0d39558")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000027"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("3bdece9b-a798-4223-a23c-9c9dd10d042d")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000028"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("6fa616eb-99fe-46b9-8305-908765d037fd")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000029"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("7a07148a-1327-4e97-befc-b2045eacad21")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000030"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("852e86d7-aa57-4a77-81c0-054f3fb4d7f7")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000031"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("3b767929-c973-41fb-a340-4ee5feb65619")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000032"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("63619bbd-0352-41bd-9e1c-a3f7908fb5d2")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000033"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("f6b4c8bf-a9b3-4179-9f57-a8584678c0d1")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000034"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("bb47b8ca-f7cf-40fe-8945-fc532a439b53")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000035"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("52126271-ae3b-4b58-a9d2-50e2dd894087")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000036"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("981e3358-85bb-47fe-a1f5-3a3a02cf47b1")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000037"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("749408da-fcee-458d-9144-8d8dee928ba0")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000038"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("c157857c-fb0e-41fd-a414-c0f57a44b120")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000039"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("3217cdbc-76c9-4505-b9f3-23de91a6212b")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000040"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("63526c52-18ba-40e0-9889-3bd3b7fc8161")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000041"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("260cf2fa-1ca6-4cd5-92ae-8c479a80e2f0")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000042"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("130ab09c-8a36-4705-8235-9d00f75dd684")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000043"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("41794774-e919-4f4e-a42a-5ae408d3407f")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000044"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("2ff23d04-d1f6-4aa3-a48e-1c82bb9ad12a")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000045"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("d36c81c0-8e9b-41ea-8e09-464a327a16d2")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000046"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("6c51dfc1-63e0-46a6-b2bb-27c21c708b51")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000047"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("076333d5-b1f3-4b89-86fd-5a61a4451c88")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000048"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("7e834f3e-1424-4aaa-816e-d62da6df672b")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000049"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("699fa06b-a7ff-4dbd-98a7-a29c2c361665")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000050"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("00df5735-54c6-4cdf-8e2c-a64cd90ede15")); migrationBuilder.CreateIndex( name: "IX_Payments_FK_BankAccountId", table: "Payments", column: "FK_BankAccountId"); migrationBuilder.CreateIndex( name: "IX_Payments_FK_ReceivedChequeId", table: "Payments", column: "FK_ReceivedChequeId"); migrationBuilder.CreateIndex( name: "IX_SupplierPaymentGRNs_FK_GoodsReceiptId", table: "SupplierPaymentGRNs", column: "FK_GoodsReceiptId"); migrationBuilder.CreateIndex( name: "IX_SupplierPaymentGRNs_FK_SupplierPaymentId", table: "SupplierPaymentGRNs", column: "FK_SupplierPaymentId"); migrationBuilder.CreateIndex( name: "IX_SupplierPayments_FK_BankAccountId", table: "SupplierPayments", column: "FK_BankAccountId"); migrationBuilder.CreateIndex( name: "IX_SupplierPayments_FK_ChequePageId", table: "SupplierPayments", column: "FK_ChequePageId"); migrationBuilder.CreateIndex( name: "IX_SupplierPayments_FK_SupplierId", table: "SupplierPayments", column: "FK_SupplierId"); migrationBuilder.AddForeignKey( name: "FK_Payments_BankAccounts_FK_BankAccountId", table: "Payments", column: "FK_BankAccountId", principalTable: "BankAccounts", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_Payments_ReceivedCheques_FK_ReceivedChequeId", table: "Payments", column: "FK_ReceivedChequeId", principalTable: "ReceivedCheques", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Payments_BankAccounts_FK_BankAccountId", table: "Payments"); migrationBuilder.DropForeignKey( name: "FK_Payments_ReceivedCheques_FK_ReceivedChequeId", table: "Payments"); migrationBuilder.DropTable( name: "SupplierPaymentGRNs"); migrationBuilder.DropTable( name: "SupplierPayments"); migrationBuilder.DropIndex( name: "IX_Payments_FK_BankAccountId", table: "Payments"); migrationBuilder.DropIndex( name: "IX_Payments_FK_ReceivedChequeId", table: "Payments"); migrationBuilder.DropColumn( name: "FK_BankAccountId", table: "Payments"); migrationBuilder.DropColumn( name: "FK_ReceivedChequeId", table: "Payments"); migrationBuilder.AlterColumn( name: "CompanyId", table: "ReceivedCheques", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000001"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("ec13fdfa-d848-4004-b749-4b455ba0a77e")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000002"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("66f41359-cf33-4bd9-a936-816f03b23da7")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000003"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("369efbe7-f200-4b2e-bc15-858b6d2ca882")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000004"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("adc14999-08af-4b4c-937d-3ecd7c35b709")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000005"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("f1bf4ccb-45c6-4915-b941-6b507eb1e44f")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000006"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("1cbd132a-ea3d-46b2-8150-c5a077b6b36a")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000007"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("362118bd-1d4c-4576-95f6-7da899bf7368")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000008"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("15e94675-d2ae-4f5a-8198-6297a26d7a2c")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000009"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("4af2ab93-d3ba-4bda-b440-167f672cc166")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000010"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("bc5ba5f8-f20a-432a-985b-95b9500ce693")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000011"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("4f43f82b-8e6a-4729-9ded-c78c7dde24a7")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000012"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("7ac3df8c-f5c3-4d57-b537-5d5ca4ec1e11")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000013"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("44ec8d0f-f540-4786-9d9a-9194fa091286")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000014"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("143c4280-21be-4852-adc5-7cd17ab595fd")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000015"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("d00b144e-bf2d-4a04-9c85-0c14544edf48")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000016"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("9a72b7e4-1197-4032-8ec6-ebb3442a267f")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000017"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("5ec2af6e-d1db-4811-9c37-94a260e6ef9b")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000018"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("a71aceba-5199-4824-8b4e-998b108c082c")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000019"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("4bd840bf-da52-46fd-b065-40253f915c7c")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000020"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("8b4d8558-dba9-45bb-b263-f066580a55e9")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000021"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("0ee1a2e0-e4d2-4af3-9cca-ffad05bc1e20")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000022"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("700be5ec-0c11-497b-808a-80e7a854d2b4")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000023"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("b9978e5a-14b1-462a-9b7b-c9c32c4decb9")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000024"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("1e7cc9d4-f65e-434b-90e5-f78b4fda39b8")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000025"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("bfb3f80b-32c3-43b0-b216-f05e55f09360")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000026"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("fcfe2242-93ad-4c6d-8eec-3ec1f1270d0a")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000027"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("8e6eeb90-966f-4417-a1ae-148cdaa64904")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000028"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("6df60aea-63f3-465e-96fb-9a7304ead3c2")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000029"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("c0e21519-a095-4c7f-af42-e26efdcdd31e")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000030"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("496bbf8d-d84d-4c21-b190-bf95a06b4113")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000031"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("36f55476-d749-459b-92d9-839919499460")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000032"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("d90301fa-8990-49cf-8fa0-228ea7e684bc")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000033"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("8da4cd2a-1fd2-4417-bb6d-9e91174193f5")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000034"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("cc9bed46-a230-4611-88b4-d568abca857e")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000035"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("4d791413-ac44-4165-87b8-c28dbfa49230")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000036"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("2bb28028-8b12-4937-9dc6-68e35b100007")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000037"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("fdc8d3d9-a32d-4322-8144-93ff677beea3")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000038"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("b1ea0901-08e8-4dea-8ac3-15b522a2f274")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000039"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("116ac7bf-741e-4d4f-a313-2e7946a50044")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000040"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("7fd97ca6-a14b-4e42-8474-5471c0ef79a9")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000041"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("e58f35b2-8308-4fbb-b3ca-db9d037347cd")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000042"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("dc6b2750-083b-4653-a986-7af7aaec8136")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000043"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("6629888a-eb6b-433f-bbfe-ee5d947fb5b2")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000044"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("94b97271-7593-4cec-9290-802e9a26f0d8")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000045"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("0dc88aca-4e86-4712-988f-8db6a466531d")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000046"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("c8839187-4358-4218-bf3d-5ea4ed758661")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000047"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("5c731906-8d81-4f85-abad-230050af0bd0")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000048"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("d6e3db40-ca38-4caf-88d8-ce87475b4d87")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000049"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("398f1c4d-5d7d-4af4-9aa7-a88d7abf9a33")); migrationBuilder.UpdateData( table: "RolePermissions", keyColumns: new[] { "FK_PermissionId", "FK_RoleId" }, keyValues: new object[] { new Guid("20000000-0000-0000-0000-000000000050"), new Guid("10000000-0000-0000-0000-000000000007") }, column: "Id", value: new Guid("0f6c66e6-833c-4b52-ba2c-09da8dbead6f")); } } }