namespace WePlatform.Migrations { using System; using System.Collections.Generic; using System.Data.Entity.Infrastructure.Annotations; using System.Data.Entity.Migrations; public partial class Update427001 : DbMigration { public override void Up() { DropForeignKey("dbo.WeLib_Behaviors", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.WeModel_EngineModels", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.WeLib_Guides", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.WeLib_Scenes", "DeleterUserId", "dbo.Sys_Users"); DropIndex("dbo.WeLib_Behaviors", new[] { "IsDeleted" }); DropIndex("dbo.WeLib_Behaviors", new[] { "DeleterUserId" }); DropIndex("dbo.WeModel_EngineModels", new[] { "IsDeleted" }); DropIndex("dbo.WeModel_EngineModels", new[] { "DeleterUserId" }); DropIndex("dbo.WeLib_Guides", new[] { "IsDeleted" }); DropIndex("dbo.WeLib_Guides", new[] { "DeleterUserId" }); DropIndex("dbo.WeLib_Scenes", new[] { "IsDeleted" }); DropIndex("dbo.WeLib_Scenes", new[] { "DeleterUserId" }); AlterTableAnnotations( "dbo.WeLib_Behaviors", c => new { Id = c.String(nullable: false, maxLength: 128), SceneCategory = c.String(maxLength: 128), BehaviorTag = c.String(maxLength: 500), Description = c.String(maxLength: 500), RoleLogicType = c.Int(nullable: false), RuleKeyword = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_BehaviorInfo_SoftDelete", new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null) }, }); AlterTableAnnotations( "dbo.WeModel_EngineModels", c => new { Id = c.String(nullable: false, maxLength: 128), ModelName = c.String(maxLength: 50), Version = c.String(maxLength: 50), Description = c.String(maxLength: 500), ModelType = c.Int(nullable: false), EngineNo = c.String(maxLength: 128), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_EngineModelInfo_SoftDelete", new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null) }, }); AlterTableAnnotations( "dbo.WeLib_Guides", c => new { Id = c.String(nullable: false, maxLength: 128), Name = c.String(maxLength: 50), Description = c.String(maxLength: 500), GuideType = c.Int(nullable: false), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_GuideInfo_SoftDelete", new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null) }, }); AlterTableAnnotations( "dbo.WeLib_Scenes", c => new { Id = c.String(nullable: false, maxLength: 128), Name = c.String(maxLength: 50), SceneCategory = c.String(maxLength: 128), SceneTag = c.String(maxLength: 200), Description = c.String(maxLength: 500), SceneType = c.Int(nullable: false), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_SceneInfo_SoftDelete", new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null) }, }); DropColumn("dbo.WeLib_Behaviors", "IsDeleted"); DropColumn("dbo.WeLib_Behaviors", "DeleterUserId"); DropColumn("dbo.WeLib_Behaviors", "DeletionTime"); DropColumn("dbo.WeModel_EngineModels", "IsDeleted"); DropColumn("dbo.WeModel_EngineModels", "DeleterUserId"); DropColumn("dbo.WeModel_EngineModels", "DeletionTime"); DropColumn("dbo.WeLib_Guides", "IsDeleted"); DropColumn("dbo.WeLib_Guides", "DeleterUserId"); DropColumn("dbo.WeLib_Guides", "DeletionTime"); DropColumn("dbo.WeLib_Scenes", "IsDeleted"); DropColumn("dbo.WeLib_Scenes", "DeleterUserId"); DropColumn("dbo.WeLib_Scenes", "DeletionTime"); } public override void Down() { AddColumn("dbo.WeLib_Scenes", "DeletionTime", c => c.DateTime()); AddColumn("dbo.WeLib_Scenes", "DeleterUserId", c => c.Long()); AddColumn("dbo.WeLib_Scenes", "IsDeleted", c => c.Boolean(nullable: false)); AddColumn("dbo.WeLib_Guides", "DeletionTime", c => c.DateTime()); AddColumn("dbo.WeLib_Guides", "DeleterUserId", c => c.Long()); AddColumn("dbo.WeLib_Guides", "IsDeleted", c => c.Boolean(nullable: false)); AddColumn("dbo.WeModel_EngineModels", "DeletionTime", c => c.DateTime()); AddColumn("dbo.WeModel_EngineModels", "DeleterUserId", c => c.Long()); AddColumn("dbo.WeModel_EngineModels", "IsDeleted", c => c.Boolean(nullable: false)); AddColumn("dbo.WeLib_Behaviors", "DeletionTime", c => c.DateTime()); AddColumn("dbo.WeLib_Behaviors", "DeleterUserId", c => c.Long()); AddColumn("dbo.WeLib_Behaviors", "IsDeleted", c => c.Boolean(nullable: false)); AlterTableAnnotations( "dbo.WeLib_Scenes", c => new { Id = c.String(nullable: false, maxLength: 128), Name = c.String(maxLength: 50), SceneCategory = c.String(maxLength: 128), SceneTag = c.String(maxLength: 200), Description = c.String(maxLength: 500), SceneType = c.Int(nullable: false), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_SceneInfo_SoftDelete", new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition") }, }); AlterTableAnnotations( "dbo.WeLib_Guides", c => new { Id = c.String(nullable: false, maxLength: 128), Name = c.String(maxLength: 50), Description = c.String(maxLength: 500), GuideType = c.Int(nullable: false), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_GuideInfo_SoftDelete", new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition") }, }); AlterTableAnnotations( "dbo.WeModel_EngineModels", c => new { Id = c.String(nullable: false, maxLength: 128), ModelName = c.String(maxLength: 50), Version = c.String(maxLength: 50), Description = c.String(maxLength: 500), ModelType = c.Int(nullable: false), EngineNo = c.String(maxLength: 128), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_EngineModelInfo_SoftDelete", new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition") }, }); AlterTableAnnotations( "dbo.WeLib_Behaviors", c => new { Id = c.String(nullable: false, maxLength: 128), SceneCategory = c.String(maxLength: 128), BehaviorTag = c.String(maxLength: 500), Description = c.String(maxLength: 500), RoleLogicType = c.Int(nullable: false), RuleKeyword = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_BehaviorInfo_SoftDelete", new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition") }, }); CreateIndex("dbo.WeLib_Scenes", "DeleterUserId"); CreateIndex("dbo.WeLib_Scenes", "IsDeleted"); CreateIndex("dbo.WeLib_Guides", "DeleterUserId"); CreateIndex("dbo.WeLib_Guides", "IsDeleted"); CreateIndex("dbo.WeModel_EngineModels", "DeleterUserId"); CreateIndex("dbo.WeModel_EngineModels", "IsDeleted"); CreateIndex("dbo.WeLib_Behaviors", "DeleterUserId"); CreateIndex("dbo.WeLib_Behaviors", "IsDeleted"); AddForeignKey("dbo.WeLib_Scenes", "DeleterUserId", "dbo.Sys_Users", "Id"); AddForeignKey("dbo.WeLib_Guides", "DeleterUserId", "dbo.Sys_Users", "Id"); AddForeignKey("dbo.WeModel_EngineModels", "DeleterUserId", "dbo.Sys_Users", "Id"); AddForeignKey("dbo.WeLib_Behaviors", "DeleterUserId", "dbo.Sys_Users", "Id"); } } }