202103200915454_Update20210320001.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. namespace ContractService.Migrations
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data.Entity.Infrastructure.Annotations;
  6. using System.Data.Entity.Migrations;
  7. public partial class Update20210320001 : DbMigration
  8. {
  9. public override void Up()
  10. {
  11. AlterTableAnnotations(
  12. "dbo.Ls_LegalContractKeyPoints",
  13. c => new
  14. {
  15. Id = c.String(nullable: false, maxLength: 128),
  16. ParentNo = c.String(maxLength: 128),
  17. Name = c.String(maxLength: 50),
  18. Tags = c.String(maxLength: 200),
  19. Description = c.String(maxLength: 500),
  20. KeyPointLevel = c.Int(nullable: false),
  21. KeyPointState = c.Int(nullable: false),
  22. ExpireDate = c.DateTime(),
  23. AlarmDate = c.DateTime(),
  24. ExecuteDate = c.DateTime(),
  25. ExpireDay = c.Int(nullable: false),
  26. AlarmDay = c.Int(nullable: false),
  27. KeyPointPath = c.String(maxLength: 500),
  28. ContractNo = c.String(maxLength: 128),
  29. Remark = c.String(maxLength: 1000),
  30. NotifyType = c.Int(nullable: false),
  31. IsDeleted = c.Boolean(nullable: false),
  32. DeleterUserId = c.Long(),
  33. DeletionTime = c.DateTime(),
  34. LastModificationTime = c.DateTime(),
  35. LastModifierUserId = c.Long(),
  36. CreationTime = c.DateTime(nullable: false),
  37. CreatorUserId = c.Long(),
  38. },
  39. annotations: new Dictionary<string, AnnotationValues>
  40. {
  41. {
  42. "DynamicFilter_LegalContractKeyPointInfo_SoftDelete",
  43. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  44. },
  45. });
  46. AddColumn("dbo.Ls_LegalContractKeyPoints", "IsDeleted", c => c.Boolean(nullable: false));
  47. AddColumn("dbo.Ls_LegalContractKeyPoints", "DeleterUserId", c => c.Long());
  48. AddColumn("dbo.Ls_LegalContractKeyPoints", "DeletionTime", c => c.DateTime());
  49. CreateIndex("dbo.Ls_LegalContractKeyPoints", "IsDeleted");
  50. CreateIndex("dbo.Ls_LegalContractKeyPoints", "DeleterUserId");
  51. AddForeignKey("dbo.Ls_LegalContractKeyPoints", "DeleterUserId", "dbo.Sys_Users", "Id");
  52. }
  53. public override void Down()
  54. {
  55. DropForeignKey("dbo.Ls_LegalContractKeyPoints", "DeleterUserId", "dbo.Sys_Users");
  56. DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "DeleterUserId" });
  57. DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "IsDeleted" });
  58. DropColumn("dbo.Ls_LegalContractKeyPoints", "DeletionTime");
  59. DropColumn("dbo.Ls_LegalContractKeyPoints", "DeleterUserId");
  60. DropColumn("dbo.Ls_LegalContractKeyPoints", "IsDeleted");
  61. AlterTableAnnotations(
  62. "dbo.Ls_LegalContractKeyPoints",
  63. c => new
  64. {
  65. Id = c.String(nullable: false, maxLength: 128),
  66. ParentNo = c.String(maxLength: 128),
  67. Name = c.String(maxLength: 50),
  68. Tags = c.String(maxLength: 200),
  69. Description = c.String(maxLength: 500),
  70. KeyPointLevel = c.Int(nullable: false),
  71. KeyPointState = c.Int(nullable: false),
  72. ExpireDate = c.DateTime(),
  73. AlarmDate = c.DateTime(),
  74. ExecuteDate = c.DateTime(),
  75. ExpireDay = c.Int(nullable: false),
  76. AlarmDay = c.Int(nullable: false),
  77. KeyPointPath = c.String(maxLength: 500),
  78. ContractNo = c.String(maxLength: 128),
  79. Remark = c.String(maxLength: 1000),
  80. NotifyType = c.Int(nullable: false),
  81. IsDeleted = c.Boolean(nullable: false),
  82. DeleterUserId = c.Long(),
  83. DeletionTime = c.DateTime(),
  84. LastModificationTime = c.DateTime(),
  85. LastModifierUserId = c.Long(),
  86. CreationTime = c.DateTime(nullable: false),
  87. CreatorUserId = c.Long(),
  88. },
  89. annotations: new Dictionary<string, AnnotationValues>
  90. {
  91. {
  92. "DynamicFilter_LegalContractKeyPointInfo_SoftDelete",
  93. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  94. },
  95. });
  96. }
  97. }
  98. }