202006190913434_AddPortraitRemark.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 AddPortraitRemark : DbMigration
  8. {
  9. public override void Up()
  10. {
  11. CreateTable(
  12. "dbo.Bs_PortraitMassage",
  13. c => new
  14. {
  15. Id = c.Int(nullable: false, identity: true),
  16. Name = c.String(maxLength: 50),
  17. RemarkContent = c.String(maxLength: 500),
  18. RemarkType = c.Int(nullable: false),
  19. Remark = c.String(maxLength: 500),
  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, object>
  29. {
  30. { "DynamicFilter_PortraitRemarkInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  31. })
  32. .PrimaryKey(t => t.Id)
  33. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  34. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  35. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  36. .Index(t => t.IsDeleted)
  37. .Index(t => t.DeleterUserId)
  38. .Index(t => t.LastModifierUserId)
  39. .Index(t => t.CreatorUserId);
  40. AddColumn("dbo.Train_CampGroups", "RoundIndex", c => c.Int(nullable: false));
  41. }
  42. public override void Down()
  43. {
  44. DropForeignKey("dbo.Bs_PortraitMassage", "LastModifierUserId", "dbo.Sys_Users");
  45. DropForeignKey("dbo.Bs_PortraitMassage", "DeleterUserId", "dbo.Sys_Users");
  46. DropForeignKey("dbo.Bs_PortraitMassage", "CreatorUserId", "dbo.Sys_Users");
  47. DropIndex("dbo.Bs_PortraitMassage", new[] { "CreatorUserId" });
  48. DropIndex("dbo.Bs_PortraitMassage", new[] { "LastModifierUserId" });
  49. DropIndex("dbo.Bs_PortraitMassage", new[] { "DeleterUserId" });
  50. DropIndex("dbo.Bs_PortraitMassage", new[] { "IsDeleted" });
  51. DropColumn("dbo.Train_CampGroups", "RoundIndex");
  52. DropTable("dbo.Bs_PortraitMassage",
  53. removedAnnotations: new Dictionary<string, object>
  54. {
  55. { "DynamicFilter_PortraitRemarkInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  56. });
  57. }
  58. }
  59. }