202006030309112_AddGroupRole.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. namespace WeApp.Migrations
  2. {
  3. using System;
  4. using System.Data.Entity.Migrations;
  5. public partial class AddGroupRole : DbMigration
  6. {
  7. public override void Up()
  8. {
  9. CreateTable(
  10. "dbo.Train_CampGroupRoles",
  11. c => new
  12. {
  13. Id = c.Int(nullable: false, identity: true),
  14. GroupNo = c.String(),
  15. RoleNames = c.String(),
  16. CreationTime = c.DateTime(nullable: false),
  17. CreatorUserId = c.Long(),
  18. })
  19. .PrimaryKey(t => t.Id)
  20. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  21. .Index(t => t.CreatorUserId);
  22. AddColumn("dbo.Train_CampGroups", "RunningInfo", c => c.String());
  23. }
  24. public override void Down()
  25. {
  26. DropForeignKey("dbo.Train_CampGroupRoles", "CreatorUserId", "dbo.Sys_Users");
  27. DropIndex("dbo.Train_CampGroupRoles", new[] { "CreatorUserId" });
  28. DropColumn("dbo.Train_CampGroups", "RunningInfo");
  29. DropTable("dbo.Train_CampGroupRoles");
  30. }
  31. }
  32. }