20241112095808_altrContractDura.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class altrContractDura : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.DropColumn(
  12. name: "JobTitleId",
  13. table: "Contracts");
  14. migrationBuilder.AddColumn<string>(
  15. name: "JobTitleName",
  16. table: "Contracts",
  17. type: "nvarchar(max)",
  18. nullable: true);
  19. migrationBuilder.AddColumn<int>(
  20. name: "WorkingHoursNum",
  21. table: "Contracts",
  22. type: "int",
  23. nullable: false,
  24. defaultValue: 0);
  25. migrationBuilder.AlterColumn<decimal>(
  26. name: "EntitlementPercent",
  27. table: "ContractAllowance",
  28. type: "decimal(18,2)",
  29. nullable: false,
  30. oldClrType: typeof(long),
  31. oldType: "bigint");
  32. migrationBuilder.AlterColumn<decimal>(
  33. name: "EntitlementAmount",
  34. table: "ContractAllowance",
  35. type: "decimal(18,2)",
  36. nullable: false,
  37. oldClrType: typeof(long),
  38. oldType: "bigint");
  39. }
  40. /// <inheritdoc />
  41. protected override void Down(MigrationBuilder migrationBuilder)
  42. {
  43. migrationBuilder.DropColumn(
  44. name: "JobTitleName",
  45. table: "Contracts");
  46. migrationBuilder.DropColumn(
  47. name: "WorkingHoursNum",
  48. table: "Contracts");
  49. migrationBuilder.AddColumn<int>(
  50. name: "JobTitleId",
  51. table: "Contracts",
  52. type: "int",
  53. nullable: true);
  54. migrationBuilder.AlterColumn<long>(
  55. name: "EntitlementPercent",
  56. table: "ContractAllowance",
  57. type: "bigint",
  58. nullable: false,
  59. oldClrType: typeof(decimal),
  60. oldType: "decimal(18,2)");
  61. migrationBuilder.AlterColumn<long>(
  62. name: "EntitlementAmount",
  63. table: "ContractAllowance",
  64. type: "bigint",
  65. nullable: false,
  66. oldClrType: typeof(decimal),
  67. oldType: "decimal(18,2)");
  68. }
  69. }
  70. }