20241224101338_altrContracyAttachs.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace MTWorkHR.Infrastructure.Migrations
  4. {
  5. /// <inheritdoc />
  6. public partial class altrContracyAttachs : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.DropForeignKey(
  12. name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
  13. table: "ContractTaskAttachment");
  14. migrationBuilder.DropForeignKey(
  15. name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
  16. table: "ProjectStageAttachment");
  17. migrationBuilder.DropIndex(
  18. name: "IX_ProjectStageAttachment_AttachmentTypeId",
  19. table: "ProjectStageAttachment");
  20. migrationBuilder.DropIndex(
  21. name: "IX_ContractTaskAttachment_AttachmentTypeId",
  22. table: "ContractTaskAttachment");
  23. migrationBuilder.DropColumn(
  24. name: "Content",
  25. table: "ProjectStageAttachment");
  26. migrationBuilder.DropColumn(
  27. name: "Content",
  28. table: "ContractTaskAttachment");
  29. }
  30. /// <inheritdoc />
  31. protected override void Down(MigrationBuilder migrationBuilder)
  32. {
  33. migrationBuilder.AddColumn<byte[]>(
  34. name: "Content",
  35. table: "ProjectStageAttachment",
  36. type: "varbinary(max)",
  37. nullable: false,
  38. defaultValue: new byte[0]);
  39. migrationBuilder.AddColumn<byte[]>(
  40. name: "Content",
  41. table: "ContractTaskAttachment",
  42. type: "varbinary(max)",
  43. nullable: false,
  44. defaultValue: new byte[0]);
  45. migrationBuilder.CreateIndex(
  46. name: "IX_ProjectStageAttachment_AttachmentTypeId",
  47. table: "ProjectStageAttachment",
  48. column: "AttachmentTypeId");
  49. migrationBuilder.CreateIndex(
  50. name: "IX_ContractTaskAttachment_AttachmentTypeId",
  51. table: "ContractTaskAttachment",
  52. column: "AttachmentTypeId");
  53. migrationBuilder.AddForeignKey(
  54. name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
  55. table: "ContractTaskAttachment",
  56. column: "AttachmentTypeId",
  57. principalTable: "AttachmentTypes",
  58. principalColumn: "Id");
  59. migrationBuilder.AddForeignKey(
  60. name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
  61. table: "ProjectStageAttachment",
  62. column: "AttachmentTypeId",
  63. principalTable: "AttachmentTypes",
  64. principalColumn: "Id");
  65. }
  66. }
  67. }