202004261600497_Update427001.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. namespace WePlatform.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 Update427001 : DbMigration
  8. {
  9. public override void Up()
  10. {
  11. DropForeignKey("dbo.WeLib_Behaviors", "DeleterUserId", "dbo.Sys_Users");
  12. DropForeignKey("dbo.WeModel_EngineModels", "DeleterUserId", "dbo.Sys_Users");
  13. DropForeignKey("dbo.WeLib_Guides", "DeleterUserId", "dbo.Sys_Users");
  14. DropForeignKey("dbo.WeLib_Scenes", "DeleterUserId", "dbo.Sys_Users");
  15. DropIndex("dbo.WeLib_Behaviors", new[] { "IsDeleted" });
  16. DropIndex("dbo.WeLib_Behaviors", new[] { "DeleterUserId" });
  17. DropIndex("dbo.WeModel_EngineModels", new[] { "IsDeleted" });
  18. DropIndex("dbo.WeModel_EngineModels", new[] { "DeleterUserId" });
  19. DropIndex("dbo.WeLib_Guides", new[] { "IsDeleted" });
  20. DropIndex("dbo.WeLib_Guides", new[] { "DeleterUserId" });
  21. DropIndex("dbo.WeLib_Scenes", new[] { "IsDeleted" });
  22. DropIndex("dbo.WeLib_Scenes", new[] { "DeleterUserId" });
  23. AlterTableAnnotations(
  24. "dbo.WeLib_Behaviors",
  25. c => new
  26. {
  27. Id = c.String(nullable: false, maxLength: 128),
  28. SceneCategory = c.String(maxLength: 128),
  29. BehaviorTag = c.String(maxLength: 500),
  30. Description = c.String(maxLength: 500),
  31. RoleLogicType = c.Int(nullable: false),
  32. RuleKeyword = c.String(maxLength: 500),
  33. LastModificationTime = c.DateTime(),
  34. LastModifierUserId = c.Long(),
  35. CreationTime = c.DateTime(nullable: false),
  36. CreatorUserId = c.Long(),
  37. },
  38. annotations: new Dictionary<string, AnnotationValues>
  39. {
  40. {
  41. "DynamicFilter_BehaviorInfo_SoftDelete",
  42. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  43. },
  44. });
  45. AlterTableAnnotations(
  46. "dbo.WeModel_EngineModels",
  47. c => new
  48. {
  49. Id = c.String(nullable: false, maxLength: 128),
  50. ModelName = c.String(maxLength: 50),
  51. Version = c.String(maxLength: 50),
  52. Description = c.String(maxLength: 500),
  53. ModelType = c.Int(nullable: false),
  54. EngineNo = c.String(maxLength: 128),
  55. Remark = c.String(maxLength: 500),
  56. LastModificationTime = c.DateTime(),
  57. LastModifierUserId = c.Long(),
  58. CreationTime = c.DateTime(nullable: false),
  59. CreatorUserId = c.Long(),
  60. },
  61. annotations: new Dictionary<string, AnnotationValues>
  62. {
  63. {
  64. "DynamicFilter_EngineModelInfo_SoftDelete",
  65. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  66. },
  67. });
  68. AlterTableAnnotations(
  69. "dbo.WeLib_Guides",
  70. c => new
  71. {
  72. Id = c.String(nullable: false, maxLength: 128),
  73. Name = c.String(maxLength: 50),
  74. Description = c.String(maxLength: 500),
  75. GuideType = c.Int(nullable: false),
  76. Remark = c.String(maxLength: 500),
  77. LastModificationTime = c.DateTime(),
  78. LastModifierUserId = c.Long(),
  79. CreationTime = c.DateTime(nullable: false),
  80. CreatorUserId = c.Long(),
  81. },
  82. annotations: new Dictionary<string, AnnotationValues>
  83. {
  84. {
  85. "DynamicFilter_GuideInfo_SoftDelete",
  86. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  87. },
  88. });
  89. AlterTableAnnotations(
  90. "dbo.WeLib_Scenes",
  91. c => new
  92. {
  93. Id = c.String(nullable: false, maxLength: 128),
  94. Name = c.String(maxLength: 50),
  95. SceneCategory = c.String(maxLength: 128),
  96. SceneTag = c.String(maxLength: 200),
  97. Description = c.String(maxLength: 500),
  98. SceneType = c.Int(nullable: false),
  99. Remark = c.String(maxLength: 500),
  100. LastModificationTime = c.DateTime(),
  101. LastModifierUserId = c.Long(),
  102. CreationTime = c.DateTime(nullable: false),
  103. CreatorUserId = c.Long(),
  104. },
  105. annotations: new Dictionary<string, AnnotationValues>
  106. {
  107. {
  108. "DynamicFilter_SceneInfo_SoftDelete",
  109. new AnnotationValues(oldValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition", newValue: null)
  110. },
  111. });
  112. DropColumn("dbo.WeLib_Behaviors", "IsDeleted");
  113. DropColumn("dbo.WeLib_Behaviors", "DeleterUserId");
  114. DropColumn("dbo.WeLib_Behaviors", "DeletionTime");
  115. DropColumn("dbo.WeModel_EngineModels", "IsDeleted");
  116. DropColumn("dbo.WeModel_EngineModels", "DeleterUserId");
  117. DropColumn("dbo.WeModel_EngineModels", "DeletionTime");
  118. DropColumn("dbo.WeLib_Guides", "IsDeleted");
  119. DropColumn("dbo.WeLib_Guides", "DeleterUserId");
  120. DropColumn("dbo.WeLib_Guides", "DeletionTime");
  121. DropColumn("dbo.WeLib_Scenes", "IsDeleted");
  122. DropColumn("dbo.WeLib_Scenes", "DeleterUserId");
  123. DropColumn("dbo.WeLib_Scenes", "DeletionTime");
  124. }
  125. public override void Down()
  126. {
  127. AddColumn("dbo.WeLib_Scenes", "DeletionTime", c => c.DateTime());
  128. AddColumn("dbo.WeLib_Scenes", "DeleterUserId", c => c.Long());
  129. AddColumn("dbo.WeLib_Scenes", "IsDeleted", c => c.Boolean(nullable: false));
  130. AddColumn("dbo.WeLib_Guides", "DeletionTime", c => c.DateTime());
  131. AddColumn("dbo.WeLib_Guides", "DeleterUserId", c => c.Long());
  132. AddColumn("dbo.WeLib_Guides", "IsDeleted", c => c.Boolean(nullable: false));
  133. AddColumn("dbo.WeModel_EngineModels", "DeletionTime", c => c.DateTime());
  134. AddColumn("dbo.WeModel_EngineModels", "DeleterUserId", c => c.Long());
  135. AddColumn("dbo.WeModel_EngineModels", "IsDeleted", c => c.Boolean(nullable: false));
  136. AddColumn("dbo.WeLib_Behaviors", "DeletionTime", c => c.DateTime());
  137. AddColumn("dbo.WeLib_Behaviors", "DeleterUserId", c => c.Long());
  138. AddColumn("dbo.WeLib_Behaviors", "IsDeleted", c => c.Boolean(nullable: false));
  139. AlterTableAnnotations(
  140. "dbo.WeLib_Scenes",
  141. c => new
  142. {
  143. Id = c.String(nullable: false, maxLength: 128),
  144. Name = c.String(maxLength: 50),
  145. SceneCategory = c.String(maxLength: 128),
  146. SceneTag = c.String(maxLength: 200),
  147. Description = c.String(maxLength: 500),
  148. SceneType = c.Int(nullable: false),
  149. Remark = c.String(maxLength: 500),
  150. LastModificationTime = c.DateTime(),
  151. LastModifierUserId = c.Long(),
  152. CreationTime = c.DateTime(nullable: false),
  153. CreatorUserId = c.Long(),
  154. },
  155. annotations: new Dictionary<string, AnnotationValues>
  156. {
  157. {
  158. "DynamicFilter_SceneInfo_SoftDelete",
  159. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  160. },
  161. });
  162. AlterTableAnnotations(
  163. "dbo.WeLib_Guides",
  164. c => new
  165. {
  166. Id = c.String(nullable: false, maxLength: 128),
  167. Name = c.String(maxLength: 50),
  168. Description = c.String(maxLength: 500),
  169. GuideType = c.Int(nullable: false),
  170. Remark = c.String(maxLength: 500),
  171. LastModificationTime = c.DateTime(),
  172. LastModifierUserId = c.Long(),
  173. CreationTime = c.DateTime(nullable: false),
  174. CreatorUserId = c.Long(),
  175. },
  176. annotations: new Dictionary<string, AnnotationValues>
  177. {
  178. {
  179. "DynamicFilter_GuideInfo_SoftDelete",
  180. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  181. },
  182. });
  183. AlterTableAnnotations(
  184. "dbo.WeModel_EngineModels",
  185. c => new
  186. {
  187. Id = c.String(nullable: false, maxLength: 128),
  188. ModelName = c.String(maxLength: 50),
  189. Version = c.String(maxLength: 50),
  190. Description = c.String(maxLength: 500),
  191. ModelType = c.Int(nullable: false),
  192. EngineNo = c.String(maxLength: 128),
  193. Remark = c.String(maxLength: 500),
  194. LastModificationTime = c.DateTime(),
  195. LastModifierUserId = c.Long(),
  196. CreationTime = c.DateTime(nullable: false),
  197. CreatorUserId = c.Long(),
  198. },
  199. annotations: new Dictionary<string, AnnotationValues>
  200. {
  201. {
  202. "DynamicFilter_EngineModelInfo_SoftDelete",
  203. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  204. },
  205. });
  206. AlterTableAnnotations(
  207. "dbo.WeLib_Behaviors",
  208. c => new
  209. {
  210. Id = c.String(nullable: false, maxLength: 128),
  211. SceneCategory = c.String(maxLength: 128),
  212. BehaviorTag = c.String(maxLength: 500),
  213. Description = c.String(maxLength: 500),
  214. RoleLogicType = c.Int(nullable: false),
  215. RuleKeyword = c.String(maxLength: 500),
  216. LastModificationTime = c.DateTime(),
  217. LastModifierUserId = c.Long(),
  218. CreationTime = c.DateTime(nullable: false),
  219. CreatorUserId = c.Long(),
  220. },
  221. annotations: new Dictionary<string, AnnotationValues>
  222. {
  223. {
  224. "DynamicFilter_BehaviorInfo_SoftDelete",
  225. new AnnotationValues(oldValue: null, newValue: "EntityFramework.DynamicFilters.DynamicFilterDefinition")
  226. },
  227. });
  228. CreateIndex("dbo.WeLib_Scenes", "DeleterUserId");
  229. CreateIndex("dbo.WeLib_Scenes", "IsDeleted");
  230. CreateIndex("dbo.WeLib_Guides", "DeleterUserId");
  231. CreateIndex("dbo.WeLib_Guides", "IsDeleted");
  232. CreateIndex("dbo.WeModel_EngineModels", "DeleterUserId");
  233. CreateIndex("dbo.WeModel_EngineModels", "IsDeleted");
  234. CreateIndex("dbo.WeLib_Behaviors", "DeleterUserId");
  235. CreateIndex("dbo.WeLib_Behaviors", "IsDeleted");
  236. AddForeignKey("dbo.WeLib_Scenes", "DeleterUserId", "dbo.Sys_Users", "Id");
  237. AddForeignKey("dbo.WeLib_Guides", "DeleterUserId", "dbo.Sys_Users", "Id");
  238. AddForeignKey("dbo.WeModel_EngineModels", "DeleterUserId", "dbo.Sys_Users", "Id");
  239. AddForeignKey("dbo.WeLib_Behaviors", "DeleterUserId", "dbo.Sys_Users", "Id");
  240. }
  241. }
  242. }