20250120121744_altrAdminRole.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
  4. namespace MTWorkHR.Infrastructure.Migrations
  5. {
  6. /// <inheritdoc />
  7. public partial class altrAdminRole : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.UpdateData(
  13. table: "AspNetRoles",
  14. keyColumn: "Id",
  15. keyValue: "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A",
  16. column: "IsAdmin",
  17. value: false);
  18. migrationBuilder.InsertData(
  19. table: "Permissions",
  20. columns: new[] { "Id", "CategoryName", "Desc", "Name", "Show" },
  21. values: new object[] { 47L, "Adminstration", "User.ResetPassword", "User.ResetPassword", false });
  22. migrationBuilder.InsertData(
  23. table: "RolePermissions",
  24. columns: new[] { "Id", "PermissionId", "PermissionName", "RoleId" },
  25. values: new object[,]
  26. {
  27. { 133L, 47L, "User.ResetPassword", "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E" },
  28. { 134L, 47L, "User.ResetPassword", "CO5B3B92-2311-48F8-9DEC-F9FAEF1F211R" },
  29. { 135L, 47L, "User.ResetPassword", "BS5B3B92-2311-48F8-9DEC-F9FAEF1F2110" }
  30. });
  31. }
  32. /// <inheritdoc />
  33. protected override void Down(MigrationBuilder migrationBuilder)
  34. {
  35. migrationBuilder.DeleteData(
  36. table: "RolePermissions",
  37. keyColumn: "Id",
  38. keyValue: 133L);
  39. migrationBuilder.DeleteData(
  40. table: "RolePermissions",
  41. keyColumn: "Id",
  42. keyValue: 134L);
  43. migrationBuilder.DeleteData(
  44. table: "RolePermissions",
  45. keyColumn: "Id",
  46. keyValue: 135L);
  47. migrationBuilder.DeleteData(
  48. table: "Permissions",
  49. keyColumn: "Id",
  50. keyValue: 47L);
  51. migrationBuilder.UpdateData(
  52. table: "AspNetRoles",
  53. keyColumn: "Id",
  54. keyValue: "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A",
  55. column: "IsAdmin",
  56. value: true);
  57. }
  58. }
  59. }