202005080248467_Update20508001.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace WePlatform.Migrations
  2. {
  3. using System;
  4. using System.Data.Entity.Migrations;
  5. public partial class Update20508001 : DbMigration
  6. {
  7. public override void Up()
  8. {
  9. CreateTable(
  10. "dbo.WeLib_EnvironResourceRelated",
  11. c => new
  12. {
  13. Id = c.Int(nullable: false, identity: true),
  14. RelatedNo = c.String(maxLength: 128),
  15. RelatedType = c.Int(nullable: false),
  16. EnvironResourceNo = c.String(maxLength: 128),
  17. CreationTime = c.DateTime(nullable: false),
  18. CreatorUserId = c.Long(),
  19. })
  20. .PrimaryKey(t => t.Id)
  21. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  22. .ForeignKey("dbo.WeLib_EnvironResources", t => t.EnvironResourceNo)
  23. .Index(t => t.EnvironResourceNo)
  24. .Index(t => t.CreatorUserId);
  25. AddColumn("dbo.WeLib_Packages", "Variable", c => c.String(maxLength: 500));
  26. AddColumn("dbo.WeLib_Scenes", "Variable", c => c.String(maxLength: 500));
  27. AddColumn("dbo.WeLib_SceneFlows", "Variable", c => c.String(maxLength: 500));
  28. }
  29. public override void Down()
  30. {
  31. DropForeignKey("dbo.WeLib_EnvironResourceRelated", "EnvironResourceNo", "dbo.WeLib_Guides");
  32. DropForeignKey("dbo.WeLib_EnvironResourceRelated", "CreatorUserId", "dbo.Sys_Users");
  33. DropIndex("dbo.WeLib_EnvironResourceRelated", new[] { "CreatorUserId" });
  34. DropIndex("dbo.WeLib_EnvironResourceRelated", new[] { "EnvironResourceNo" });
  35. DropColumn("dbo.WeLib_SceneFlows", "Variable");
  36. DropColumn("dbo.WeLib_Scenes", "Variable");
  37. DropColumn("dbo.WeLib_Packages", "Variable");
  38. DropTable("dbo.WeLib_EnvironResourceRelated");
  39. }
  40. }
  41. }