20240519110611_altrUserBD.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace MTWorkHR.Infrastructure.Migrations
  5. {
  6. /// <inheritdoc />
  7. public partial class altrUserBD : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.AddColumn<DateTime>(
  13. name: "DateOfBirth",
  14. table: "AspNetUsers",
  15. type: "datetime2",
  16. nullable: false,
  17. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
  18. migrationBuilder.AddColumn<string>(
  19. name: "IdNumber",
  20. table: "AspNetUsers",
  21. type: "nvarchar(max)",
  22. nullable: false,
  23. defaultValue: "");
  24. migrationBuilder.UpdateData(
  25. table: "AspNetUsers",
  26. keyColumn: "Id",
  27. keyValue: "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
  28. columns: new[] { "DateOfBirth", "IdNumber" },
  29. values: new object[] { new DateTime(2000, 2, 10, 0, 0, 0, 0, DateTimeKind.Unspecified), "123" });
  30. migrationBuilder.UpdateData(
  31. table: "AspNetUsers",
  32. keyColumn: "Id",
  33. keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  34. columns: new[] { "DateOfBirth", "IdNumber", "PhoneNumber" },
  35. values: new object[] { new DateTime(2001, 5, 13, 0, 0, 0, 0, DateTimeKind.Unspecified), "343434", "1234567888" });
  36. }
  37. /// <inheritdoc />
  38. protected override void Down(MigrationBuilder migrationBuilder)
  39. {
  40. migrationBuilder.DropColumn(
  41. name: "DateOfBirth",
  42. table: "AspNetUsers");
  43. migrationBuilder.DropColumn(
  44. name: "IdNumber",
  45. table: "AspNetUsers");
  46. migrationBuilder.UpdateData(
  47. table: "AspNetUsers",
  48. keyColumn: "Id",
  49. keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  50. column: "PhoneNumber",
  51. value: "1234567890");
  52. }
  53. }
  54. }