20240520154627_altrForget.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class altrForget : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AlterColumn<string>(
  12. name: "PostalCode",
  13. table: "UserAddress",
  14. type: "nvarchar(max)",
  15. nullable: true,
  16. oldClrType: typeof(string),
  17. oldType: "nvarchar(max)");
  18. migrationBuilder.AlterColumn<int>(
  19. name: "CountryId",
  20. table: "UserAddress",
  21. type: "int",
  22. nullable: true,
  23. oldClrType: typeof(int),
  24. oldType: "int");
  25. migrationBuilder.AlterColumn<string>(
  26. name: "City",
  27. table: "UserAddress",
  28. type: "nvarchar(max)",
  29. nullable: true,
  30. oldClrType: typeof(string),
  31. oldType: "nvarchar(max)");
  32. migrationBuilder.AlterColumn<string>(
  33. name: "AddressDesc",
  34. table: "UserAddress",
  35. type: "nvarchar(max)",
  36. nullable: true,
  37. oldClrType: typeof(string),
  38. oldType: "nvarchar(max)");
  39. }
  40. /// <inheritdoc />
  41. protected override void Down(MigrationBuilder migrationBuilder)
  42. {
  43. migrationBuilder.AlterColumn<string>(
  44. name: "PostalCode",
  45. table: "UserAddress",
  46. type: "nvarchar(max)",
  47. nullable: false,
  48. defaultValue: "",
  49. oldClrType: typeof(string),
  50. oldType: "nvarchar(max)",
  51. oldNullable: true);
  52. migrationBuilder.AlterColumn<int>(
  53. name: "CountryId",
  54. table: "UserAddress",
  55. type: "int",
  56. nullable: false,
  57. defaultValue: 0,
  58. oldClrType: typeof(int),
  59. oldType: "int",
  60. oldNullable: true);
  61. migrationBuilder.AlterColumn<string>(
  62. name: "City",
  63. table: "UserAddress",
  64. type: "nvarchar(max)",
  65. nullable: false,
  66. defaultValue: "",
  67. oldClrType: typeof(string),
  68. oldType: "nvarchar(max)",
  69. oldNullable: true);
  70. migrationBuilder.AlterColumn<string>(
  71. name: "AddressDesc",
  72. table: "UserAddress",
  73. type: "nvarchar(max)",
  74. nullable: false,
  75. defaultValue: "",
  76. oldClrType: typeof(string),
  77. oldType: "nvarchar(max)",
  78. oldNullable: true);
  79. }
  80. }
  81. }