202409240719249_Update2024001.cs 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. namespace WeApp.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 Update2024001 : DbMigration
  8. {
  9. public override void Up()
  10. {
  11. RenameTable(name: "dbo.Bs_StudentHelps", newName: "Bs_StudentTips");
  12. AlterTableAnnotations(
  13. "dbo.Bs_StudentTips",
  14. c => new
  15. {
  16. Id = c.String(nullable: false, maxLength: 128),
  17. Name = c.String(maxLength: 50),
  18. RoleName = c.String(maxLength: 50),
  19. Content = c.String(maxLength: 200),
  20. IsDeleted = c.Boolean(nullable: false),
  21. DeleterUserId = c.Long(),
  22. DeletionTime = c.DateTime(),
  23. LastModificationTime = c.DateTime(),
  24. LastModifierUserId = c.Long(),
  25. CreationTime = c.DateTime(nullable: false),
  26. CreatorUserId = c.Long(),
  27. },
  28. annotations: new Dictionary<string, AnnotationValues>
  29. {
  30. {
  31. "DynamicFilter_StudentHelpInfo_SoftDelete",
  32. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  33. },
  34. {
  35. "DynamicFilter_StudentTipInfo_SoftDelete",
  36. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  37. },
  38. });
  39. AddColumn("dbo.Train_Camps", "IsShowTip", c => c.Boolean(nullable: false));
  40. AddColumn("dbo.Bs_StudentTips", "Name", c => c.String(maxLength: 50));
  41. AddColumn("dbo.Bs_StudentTips", "RoleName", c => c.String(maxLength: 50));
  42. AddColumn("dbo.Bs_StudentTips", "Content", c => c.String(maxLength: 200));
  43. AddColumn("dbo.Train_CampSceneMaps", "TipNos", c => c.String());
  44. AddColumn("dbo.Train_CampGroupLogs", "ScenePath", c => c.String(maxLength: 500));
  45. DropColumn("dbo.Bs_StudentTips", "HelpName");
  46. DropColumn("dbo.Bs_StudentTips", "HelpContent");
  47. }
  48. public override void Down()
  49. {
  50. AddColumn("dbo.Bs_StudentTips", "HelpContent", c => c.String(maxLength: 200));
  51. AddColumn("dbo.Bs_StudentTips", "HelpName", c => c.String(maxLength: 50));
  52. DropColumn("dbo.Train_CampGroupLogs", "ScenePath");
  53. DropColumn("dbo.Train_CampSceneMaps", "TipNos");
  54. DropColumn("dbo.Bs_StudentTips", "Content");
  55. DropColumn("dbo.Bs_StudentTips", "RoleName");
  56. DropColumn("dbo.Bs_StudentTips", "Name");
  57. DropColumn("dbo.Train_Camps", "IsShowTip");
  58. AlterTableAnnotations(
  59. "dbo.Bs_StudentTips",
  60. c => new
  61. {
  62. Id = c.String(nullable: false, maxLength: 128),
  63. Name = c.String(maxLength: 50),
  64. RoleName = c.String(maxLength: 50),
  65. Content = c.String(maxLength: 200),
  66. IsDeleted = c.Boolean(nullable: false),
  67. DeleterUserId = c.Long(),
  68. DeletionTime = c.DateTime(),
  69. LastModificationTime = c.DateTime(),
  70. LastModifierUserId = c.Long(),
  71. CreationTime = c.DateTime(nullable: false),
  72. CreatorUserId = c.Long(),
  73. },
  74. annotations: new Dictionary<string, AnnotationValues>
  75. {
  76. {
  77. "DynamicFilter_StudentHelpInfo_SoftDelete",
  78. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  79. },
  80. {
  81. "DynamicFilter_StudentTipInfo_SoftDelete",
  82. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  83. },
  84. });
  85. RenameTable(name: "dbo.Bs_StudentTips", newName: "Bs_StudentHelps");
  86. }
  87. }
  88. }