202005290300228_InitCreate.cs 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139
  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 InitCreate : DbMigration
  8. {
  9. public override void Up()
  10. {
  11. CreateTable(
  12. "dbo.Train_BehaviorTags",
  13. c => new
  14. {
  15. Id = c.Int(nullable: false, identity: true),
  16. TagNo = c.String(maxLength: 20),
  17. TagName = c.String(maxLength: 50),
  18. CampNo = c.String(maxLength: 128),
  19. CreationTime = c.DateTime(nullable: false),
  20. CreatorUserId = c.Long(),
  21. })
  22. .PrimaryKey(t => t.Id)
  23. .ForeignKey("dbo.Train_Camps", t => t.CampNo)
  24. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  25. .Index(t => t.CampNo)
  26. .Index(t => t.CreatorUserId);
  27. CreateTable(
  28. "dbo.Train_Camps",
  29. c => new
  30. {
  31. Id = c.String(nullable: false, maxLength: 128),
  32. Name = c.String(maxLength: 50),
  33. PackageNo = c.String(maxLength: 20),
  34. PackageName = c.String(maxLength: 50),
  35. EngineModelType = c.Int(nullable: false),
  36. CampState = c.Int(nullable: false),
  37. AssessRoleNos = c.String(maxLength: 500),
  38. AssessAuto = c.Boolean(nullable: false),
  39. RoundScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  40. Variable = c.String(maxLength: 1000),
  41. ScoreRule = c.String(maxLength: 100),
  42. PlanDate = c.DateTime(nullable: false),
  43. StartDate = c.DateTime(),
  44. EngDate = c.DateTime(),
  45. TrainingMinute = c.Decimal(nullable: false, precision: 18, scale: 2),
  46. Description = c.String(maxLength: 500),
  47. EvalBehaviorTags = c.String(maxLength: 500),
  48. Remark = c.String(maxLength: 500),
  49. IsDeleted = c.Boolean(nullable: false),
  50. DeleterUserId = c.Long(),
  51. DeletionTime = c.DateTime(),
  52. LastModificationTime = c.DateTime(),
  53. LastModifierUserId = c.Long(),
  54. CreationTime = c.DateTime(nullable: false),
  55. CreatorUserId = c.Long(),
  56. },
  57. annotations: new Dictionary<string, object>
  58. {
  59. { "DynamicFilter_CampInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  60. })
  61. .PrimaryKey(t => t.Id)
  62. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  63. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  64. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  65. .Index(t => t.IsDeleted)
  66. .Index(t => t.DeleterUserId)
  67. .Index(t => t.LastModifierUserId)
  68. .Index(t => t.CreatorUserId);
  69. CreateTable(
  70. "dbo.Sys_Users",
  71. c => new
  72. {
  73. Id = c.Long(nullable: false, identity: true),
  74. NormalizedUserName = c.String(nullable: false, maxLength: 256),
  75. NormalizedEmailAddress = c.String(nullable: false, maxLength: 256),
  76. ConcurrencyStamp = c.String(maxLength: 128),
  77. AuthenticationSource = c.String(maxLength: 64),
  78. UserName = c.String(nullable: false, maxLength: 256),
  79. UserType = c.Int(nullable: false),
  80. AccountType = c.Int(),
  81. AccountNo = c.String(maxLength: 100),
  82. ImagePath = c.String(maxLength: 1000),
  83. TenantId = c.Int(),
  84. EmailAddress = c.String(nullable: false, maxLength: 256),
  85. Name = c.String(nullable: false, maxLength: 64),
  86. Surname = c.String(maxLength: 64),
  87. AvatarImagePath = c.String(maxLength: 500),
  88. Password = c.String(nullable: false, maxLength: 128),
  89. EmailConfirmationCode = c.String(maxLength: 328),
  90. PasswordResetCode = c.String(maxLength: 328),
  91. LockoutEndDateUtc = c.DateTime(),
  92. AccessFailedCount = c.Int(nullable: false),
  93. IsLockoutEnabled = c.Boolean(nullable: false),
  94. PhoneNumber = c.String(maxLength: 32),
  95. IsPhoneNumberConfirmed = c.Boolean(nullable: false),
  96. SecurityStamp = c.String(maxLength: 128),
  97. IsTwoFactorEnabled = c.Boolean(nullable: false),
  98. IsEmailConfirmed = c.Boolean(nullable: false),
  99. IsActive = c.Boolean(nullable: false),
  100. IsDeleted = c.Boolean(nullable: false),
  101. DeleterUserId = c.Long(),
  102. DeletionTime = c.DateTime(),
  103. LastModificationTime = c.DateTime(),
  104. LastModifierUserId = c.Long(),
  105. CreationTime = c.DateTime(nullable: false),
  106. CreatorUserId = c.Long(),
  107. },
  108. annotations: new Dictionary<string, object>
  109. {
  110. { "DynamicFilter_User_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  111. { "DynamicFilter_User_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  112. })
  113. .PrimaryKey(t => t.Id)
  114. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  115. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  116. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  117. .Index(t => t.UserName)
  118. .Index(t => t.UserType)
  119. .Index(t => t.AccountType)
  120. .Index(t => t.TenantId)
  121. .Index(t => t.EmailAddress)
  122. .Index(t => t.PhoneNumber)
  123. .Index(t => t.IsDeleted)
  124. .Index(t => t.DeleterUserId)
  125. .Index(t => t.LastModifierUserId)
  126. .Index(t => t.CreatorUserId);
  127. CreateTable(
  128. "dbo.Sys_UserClaims",
  129. c => new
  130. {
  131. Id = c.Long(nullable: false, identity: true),
  132. TenantId = c.Int(),
  133. UserId = c.Long(nullable: false),
  134. ClaimType = c.String(maxLength: 256),
  135. ClaimValue = c.String(),
  136. CreationTime = c.DateTime(nullable: false),
  137. CreatorUserId = c.Long(),
  138. },
  139. annotations: new Dictionary<string, object>
  140. {
  141. { "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  142. })
  143. .PrimaryKey(t => t.Id)
  144. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  145. .Index(t => t.TenantId)
  146. .Index(t => t.UserId);
  147. CreateTable(
  148. "dbo.Sys_UserLogins",
  149. c => new
  150. {
  151. Id = c.Long(nullable: false, identity: true),
  152. TenantId = c.Int(),
  153. UserId = c.Long(nullable: false),
  154. LoginProvider = c.String(nullable: false, maxLength: 128),
  155. ProviderKey = c.String(nullable: false, maxLength: 256),
  156. },
  157. annotations: new Dictionary<string, object>
  158. {
  159. { "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  160. })
  161. .PrimaryKey(t => t.Id)
  162. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  163. .Index(t => t.TenantId)
  164. .Index(t => t.UserId);
  165. CreateTable(
  166. "dbo.Sys_UserRoles",
  167. c => new
  168. {
  169. Id = c.Long(nullable: false, identity: true),
  170. TenantId = c.Int(),
  171. UserId = c.Long(nullable: false),
  172. RoleId = c.Int(nullable: false),
  173. CreationTime = c.DateTime(nullable: false),
  174. CreatorUserId = c.Long(),
  175. },
  176. annotations: new Dictionary<string, object>
  177. {
  178. { "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  179. })
  180. .PrimaryKey(t => t.Id)
  181. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  182. .Index(t => t.TenantId)
  183. .Index(t => t.UserId);
  184. CreateTable(
  185. "dbo.Sys_Settings",
  186. c => new
  187. {
  188. Id = c.Long(nullable: false, identity: true),
  189. TenantId = c.Int(),
  190. UserId = c.Long(),
  191. Name = c.String(nullable: false, maxLength: 256),
  192. Value = c.String(),
  193. DisplayName = c.String(maxLength: 50),
  194. Type = c.Int(),
  195. Description = c.String(maxLength: 500),
  196. Remark = c.String(maxLength: 500),
  197. LastModificationTime = c.DateTime(),
  198. LastModifierUserId = c.Long(),
  199. CreationTime = c.DateTime(nullable: false),
  200. CreatorUserId = c.Long(),
  201. },
  202. annotations: new Dictionary<string, object>
  203. {
  204. { "DynamicFilter_SysSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  205. })
  206. .PrimaryKey(t => t.Id)
  207. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  208. .Index(t => new { t.TenantId, t.Name, t.UserId }, unique: true);
  209. CreateTable(
  210. "dbo.Train_CampGroups",
  211. c => new
  212. {
  213. Id = c.String(nullable: false, maxLength: 128),
  214. Name = c.String(maxLength: 50),
  215. CampNo = c.String(maxLength: 128),
  216. CampGroupState = c.Int(nullable: false),
  217. StartDate = c.DateTime(),
  218. EngDate = c.DateTime(),
  219. TrainingMinute = c.Decimal(nullable: false, precision: 18, scale: 2),
  220. IsDeleted = c.Boolean(nullable: false),
  221. DeleterUserId = c.Long(),
  222. DeletionTime = c.DateTime(),
  223. LastModificationTime = c.DateTime(),
  224. LastModifierUserId = c.Long(),
  225. CreationTime = c.DateTime(nullable: false),
  226. CreatorUserId = c.Long(),
  227. },
  228. annotations: new Dictionary<string, object>
  229. {
  230. { "DynamicFilter_CampGroupInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  231. })
  232. .PrimaryKey(t => t.Id)
  233. .ForeignKey("dbo.Train_Camps", t => t.CampNo)
  234. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  235. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  236. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  237. .Index(t => t.CampNo)
  238. .Index(t => t.IsDeleted)
  239. .Index(t => t.DeleterUserId)
  240. .Index(t => t.LastModifierUserId)
  241. .Index(t => t.CreatorUserId);
  242. CreateTable(
  243. "dbo.Train_CampRoleGroups",
  244. c => new
  245. {
  246. Id = c.Int(nullable: false, identity: true),
  247. RoleGroupNo = c.String(maxLength: 128),
  248. CampNo = c.String(maxLength: 128),
  249. CreationTime = c.DateTime(nullable: false),
  250. CreatorUserId = c.Long(),
  251. })
  252. .PrimaryKey(t => t.Id)
  253. .ForeignKey("dbo.Train_Camps", t => t.CampNo)
  254. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  255. .ForeignKey("dbo.Bs_TrainingRoleGroups", t => t.RoleGroupNo)
  256. .Index(t => t.RoleGroupNo)
  257. .Index(t => t.CampNo)
  258. .Index(t => t.CreatorUserId);
  259. CreateTable(
  260. "dbo.Bs_TrainingRoleGroups",
  261. c => new
  262. {
  263. Id = c.String(nullable: false, maxLength: 128),
  264. RoleGroupName = c.String(),
  265. Roles = c.String(),
  266. Description = c.String(),
  267. IsDeleted = c.Boolean(nullable: false),
  268. DeleterUserId = c.Long(),
  269. DeletionTime = c.DateTime(),
  270. LastModificationTime = c.DateTime(),
  271. LastModifierUserId = c.Long(),
  272. CreationTime = c.DateTime(nullable: false),
  273. CreatorUserId = c.Long(),
  274. },
  275. annotations: new Dictionary<string, object>
  276. {
  277. { "DynamicFilter_TrainingRoleGroupInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  278. })
  279. .PrimaryKey(t => t.Id)
  280. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  281. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  282. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  283. .Index(t => t.IsDeleted)
  284. .Index(t => t.DeleterUserId)
  285. .Index(t => t.LastModifierUserId)
  286. .Index(t => t.CreatorUserId);
  287. CreateTable(
  288. "dbo.Train_CampSceneMaps",
  289. c => new
  290. {
  291. Id = c.Int(nullable: false, identity: true),
  292. SceneNo = c.String(),
  293. SceneName = c.String(),
  294. AttachNos = c.String(),
  295. CampNo = c.String(maxLength: 128),
  296. CreationTime = c.DateTime(nullable: false),
  297. CreatorUserId = c.Long(),
  298. })
  299. .PrimaryKey(t => t.Id)
  300. .ForeignKey("dbo.Train_Camps", t => t.CampNo)
  301. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  302. .Index(t => t.CampNo)
  303. .Index(t => t.CreatorUserId);
  304. CreateTable(
  305. "dbo.Sys_Permissions",
  306. c => new
  307. {
  308. Id = c.Long(nullable: false, identity: true),
  309. TenantId = c.Int(),
  310. Name = c.String(nullable: false, maxLength: 500),
  311. Master = c.Int(),
  312. MasterValue = c.String(maxLength: 100),
  313. Access = c.Int(),
  314. AccessValue = c.String(maxLength: 500),
  315. IsGranted = c.Boolean(nullable: false),
  316. CreationTime = c.DateTime(nullable: false),
  317. CreatorUserId = c.Long(),
  318. UserId = c.Long(),
  319. Discriminator = c.String(nullable: false, maxLength: 128),
  320. },
  321. annotations: new Dictionary<string, object>
  322. {
  323. { "DynamicFilter_DataPermission_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  324. { "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  325. { "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  326. { "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  327. })
  328. .PrimaryKey(t => t.Id)
  329. .Index(t => t.TenantId);
  330. CreateTable(
  331. "dbo.Train_CampGroupLogs",
  332. c => new
  333. {
  334. Id = c.Int(nullable: false, identity: true),
  335. CampNo = c.String(maxLength: 128),
  336. GroupNo = c.String(maxLength: 128),
  337. RoundIndex = c.Int(nullable: false),
  338. LogType = c.Int(nullable: false),
  339. LogCommand = c.String(maxLength: 30),
  340. LogMessage = c.String(maxLength: 500),
  341. RoleNo = c.String(maxLength: 20),
  342. RoleName = c.String(maxLength: 50),
  343. LogState = c.Int(nullable: false),
  344. LogScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  345. ParentNo = c.String(maxLength: 128),
  346. CreationTime = c.DateTime(nullable: false),
  347. CreatorUserId = c.Long(),
  348. })
  349. .PrimaryKey(t => t.Id)
  350. .ForeignKey("dbo.Train_CampGroups", t => t.GroupNo)
  351. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  352. .Index(t => t.GroupNo)
  353. .Index(t => t.CreatorUserId);
  354. CreateTable(
  355. "dbo.Train_CampGroupScores",
  356. c => new
  357. {
  358. Id = c.Int(nullable: false, identity: true),
  359. CampNo = c.String(maxLength: 128),
  360. GroupNo = c.String(maxLength: 128),
  361. RoundIndex = c.Int(nullable: false),
  362. SystemScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  363. CorrectionScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  364. SpecialistScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  365. AudienceScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  366. ReferenceScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  367. FinalTotalScore = c.Decimal(nullable: false, precision: 18, scale: 2),
  368. BehaviorTagScoreInfo = c.String(),
  369. CreationTime = c.DateTime(nullable: false),
  370. CreatorUserId = c.Long(),
  371. })
  372. .PrimaryKey(t => t.Id)
  373. .ForeignKey("dbo.Train_CampGroups", t => t.GroupNo)
  374. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  375. .Index(t => t.GroupNo)
  376. .Index(t => t.CreatorUserId);
  377. CreateTable(
  378. "dbo.Sys_Notifications",
  379. c => new
  380. {
  381. Id = c.Guid(nullable: false),
  382. NotificationName = c.String(nullable: false, maxLength: 96),
  383. Data = c.String(),
  384. DataTypeName = c.String(maxLength: 512),
  385. EntityTypeName = c.String(maxLength: 250),
  386. EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
  387. EntityId = c.String(maxLength: 96),
  388. Severity = c.Byte(nullable: false),
  389. UserIds = c.String(),
  390. ExcludedUserIds = c.String(),
  391. TenantIds = c.String(),
  392. CreationTime = c.DateTime(nullable: false),
  393. CreatorUserId = c.Long(),
  394. })
  395. .PrimaryKey(t => t.Id);
  396. CreateTable(
  397. "dbo.Sys_NotificationSubscriptions",
  398. c => new
  399. {
  400. Id = c.Guid(nullable: false),
  401. TenantId = c.Int(),
  402. UserId = c.Long(nullable: false),
  403. NotificationName = c.String(maxLength: 96),
  404. EntityTypeName = c.String(maxLength: 250),
  405. EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
  406. EntityId = c.String(maxLength: 96),
  407. CreationTime = c.DateTime(nullable: false),
  408. CreatorUserId = c.Long(),
  409. },
  410. annotations: new Dictionary<string, object>
  411. {
  412. { "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  413. })
  414. .PrimaryKey(t => t.Id)
  415. .Index(t => t.TenantId)
  416. .Index(t => new { t.NotificationName, t.EntityTypeName, t.EntityId, t.UserId });
  417. CreateTable(
  418. "dbo.Sys_Roles",
  419. c => new
  420. {
  421. Id = c.Int(nullable: false, identity: true),
  422. Description = c.String(),
  423. NormalizedName = c.String(nullable: false, maxLength: 32),
  424. ConcurrencyStamp = c.String(maxLength: 128),
  425. TenantId = c.Int(),
  426. Name = c.String(nullable: false, maxLength: 32),
  427. RoleType = c.Int(nullable: false),
  428. AccountType = c.Int(),
  429. DisplayName = c.String(nullable: false, maxLength: 64),
  430. IsStatic = c.Boolean(nullable: false),
  431. IsDefault = c.Boolean(nullable: false),
  432. IsDeleted = c.Boolean(nullable: false),
  433. DeleterUserId = c.Long(),
  434. DeletionTime = c.DateTime(),
  435. LastModificationTime = c.DateTime(),
  436. LastModifierUserId = c.Long(),
  437. CreationTime = c.DateTime(nullable: false),
  438. CreatorUserId = c.Long(),
  439. },
  440. annotations: new Dictionary<string, object>
  441. {
  442. { "DynamicFilter_Role_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  443. { "DynamicFilter_Role_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  444. })
  445. .PrimaryKey(t => t.Id)
  446. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  447. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  448. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  449. .Index(t => t.TenantId)
  450. .Index(t => t.Name)
  451. .Index(t => t.RoleType)
  452. .Index(t => t.AccountType)
  453. .Index(t => t.IsDeleted)
  454. .Index(t => t.DeleterUserId)
  455. .Index(t => t.LastModifierUserId)
  456. .Index(t => t.CreatorUserId);
  457. CreateTable(
  458. "dbo.Sys_RoleClaims",
  459. c => new
  460. {
  461. Id = c.Long(nullable: false, identity: true),
  462. TenantId = c.Int(),
  463. RoleId = c.Int(nullable: false),
  464. ClaimType = c.String(maxLength: 256),
  465. ClaimValue = c.String(),
  466. CreationTime = c.DateTime(nullable: false),
  467. CreatorUserId = c.Long(),
  468. },
  469. annotations: new Dictionary<string, object>
  470. {
  471. { "DynamicFilter_RoleClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  472. })
  473. .PrimaryKey(t => t.Id)
  474. .ForeignKey("dbo.Sys_Roles", t => t.RoleId)
  475. .Index(t => t.TenantId)
  476. .Index(t => t.RoleId);
  477. CreateTable(
  478. "dbo.Sys_AppGuids",
  479. c => new
  480. {
  481. Id = c.Int(nullable: false, identity: true),
  482. Step = c.Short(nullable: false),
  483. LastId = c.Int(nullable: false),
  484. IdType = c.Short(nullable: false),
  485. LastUseDate = c.DateTime(),
  486. })
  487. .PrimaryKey(t => t.Id)
  488. .Index(t => t.IdType);
  489. CreateTable(
  490. "dbo.Sys_AttachFiles",
  491. c => new
  492. {
  493. Id = c.Int(nullable: false, identity: true),
  494. AttachNo = c.String(maxLength: 32),
  495. TableName = c.String(maxLength: 50),
  496. ColumnName = c.String(maxLength: 50),
  497. SourceKey = c.String(maxLength: 50),
  498. FileTitle = c.String(maxLength: 50),
  499. FileName = c.String(maxLength: 50),
  500. FilePath = c.String(maxLength: 500),
  501. FileType = c.String(maxLength: 20),
  502. FileExt = c.String(maxLength: 10),
  503. Description = c.String(maxLength: 500),
  504. TenantId = c.Int(nullable: false),
  505. IsDeleted = c.Boolean(nullable: false),
  506. DeleterUserId = c.Long(),
  507. DeletionTime = c.DateTime(),
  508. LastModificationTime = c.DateTime(),
  509. LastModifierUserId = c.Long(),
  510. CreationTime = c.DateTime(nullable: false),
  511. CreatorUserId = c.Long(),
  512. },
  513. annotations: new Dictionary<string, object>
  514. {
  515. { "DynamicFilter_SysAttachFile_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  516. { "DynamicFilter_SysAttachFile_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  517. })
  518. .PrimaryKey(t => t.Id)
  519. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  520. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  521. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  522. .Index(t => t.TenantId)
  523. .Index(t => t.IsDeleted)
  524. .Index(t => t.DeleterUserId)
  525. .Index(t => t.LastModifierUserId)
  526. .Index(t => t.CreatorUserId);
  527. CreateTable(
  528. "dbo.Sys_Functions",
  529. c => new
  530. {
  531. Id = c.Int(nullable: false, identity: true),
  532. FunctionNo = c.String(maxLength: 100),
  533. ParentNo = c.String(maxLength: 100),
  534. FunctionName = c.String(maxLength: 100),
  535. PermissionName = c.String(maxLength: 500),
  536. FunctionType = c.Int(nullable: false),
  537. Action = c.String(maxLength: 50),
  538. Controller = c.String(maxLength: 50),
  539. Url = c.String(),
  540. Icon = c.String(maxLength: 50),
  541. Class = c.String(maxLength: 100),
  542. Script = c.String(),
  543. NeedAuth = c.Boolean(nullable: false),
  544. Sort = c.Int(nullable: false),
  545. Depth = c.Int(nullable: false),
  546. IsLeaf = c.Boolean(),
  547. IsDeleted = c.Boolean(nullable: false),
  548. DeleterUserId = c.Long(),
  549. DeletionTime = c.DateTime(),
  550. LastModificationTime = c.DateTime(),
  551. LastModifierUserId = c.Long(),
  552. CreationTime = c.DateTime(nullable: false),
  553. CreatorUserId = c.Long(),
  554. },
  555. annotations: new Dictionary<string, object>
  556. {
  557. { "DynamicFilter_SysFunction_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  558. })
  559. .PrimaryKey(t => t.Id)
  560. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  561. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  562. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  563. .Index(t => t.FunctionNo)
  564. .Index(t => t.PermissionName, unique: true)
  565. .Index(t => t.IsDeleted)
  566. .Index(t => t.DeleterUserId)
  567. .Index(t => t.LastModifierUserId)
  568. .Index(t => t.CreatorUserId);
  569. CreateTable(
  570. "dbo.Sys_SysHelps",
  571. c => new
  572. {
  573. Id = c.Int(nullable: false, identity: true),
  574. Classification = c.String(maxLength: 40),
  575. HelpTitle = c.String(nullable: false, maxLength: 50),
  576. HelpKeyWords = c.String(maxLength: 50),
  577. HelpContent = c.String(),
  578. FunctionNo = c.String(maxLength: 100),
  579. PermissionName = c.String(maxLength: 500),
  580. Sequence = c.Int(nullable: false),
  581. Description = c.String(),
  582. Remark = c.String(maxLength: 1000),
  583. IsDeleted = c.Boolean(nullable: false),
  584. DeleterUserId = c.Long(),
  585. DeletionTime = c.DateTime(),
  586. LastModificationTime = c.DateTime(),
  587. LastModifierUserId = c.Long(),
  588. CreationTime = c.DateTime(nullable: false),
  589. CreatorUserId = c.Long(),
  590. },
  591. annotations: new Dictionary<string, object>
  592. {
  593. { "DynamicFilter_SysHelp_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  594. })
  595. .PrimaryKey(t => t.Id)
  596. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  597. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  598. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  599. .Index(t => t.IsDeleted)
  600. .Index(t => t.DeleterUserId)
  601. .Index(t => t.LastModifierUserId)
  602. .Index(t => t.CreatorUserId);
  603. CreateTable(
  604. "dbo.Sys_AuditLogs",
  605. c => new
  606. {
  607. Id = c.Long(nullable: false, identity: true),
  608. TenantId = c.Int(nullable: false),
  609. UserId = c.Long(),
  610. UserName = c.String(),
  611. ServiceName = c.String(maxLength: 256),
  612. ServiceNameLang = c.String(),
  613. MethodName = c.String(maxLength: 256),
  614. MethodNameLang = c.String(),
  615. Parameters = c.String(maxLength: 1024),
  616. ExecutionTime = c.DateTime(nullable: false),
  617. ExecutionDuration = c.Int(nullable: false),
  618. ClientIpAddress = c.String(maxLength: 64),
  619. ClientName = c.String(maxLength: 128),
  620. BrowserInfo = c.String(maxLength: 512),
  621. Exception = c.String(maxLength: 2000),
  622. ImpersonatorUserId = c.Long(),
  623. ImpersonatorTenantId = c.Int(),
  624. CustomData = c.String(maxLength: 2000),
  625. LogType = c.Int(nullable: false),
  626. },
  627. annotations: new Dictionary<string, object>
  628. {
  629. { "DynamicFilter_SysLog_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  630. })
  631. .PrimaryKey(t => t.Id)
  632. .Index(t => t.TenantId)
  633. .Index(t => t.UserId);
  634. CreateTable(
  635. "dbo.Sys_States",
  636. c => new
  637. {
  638. Id = c.Int(nullable: false, identity: true),
  639. StateNo = c.String(maxLength: 32),
  640. StateName = c.String(maxLength: 50),
  641. TableName = c.String(nullable: false, maxLength: 50),
  642. ColumnName = c.String(nullable: false, maxLength: 50),
  643. CodeValue = c.String(nullable: false, maxLength: 100),
  644. DisplayValue = c.String(nullable: false, maxLength: 100),
  645. IsDeleted = c.Boolean(nullable: false),
  646. DeleterUserId = c.Long(),
  647. DeletionTime = c.DateTime(),
  648. LastModificationTime = c.DateTime(),
  649. LastModifierUserId = c.Long(),
  650. CreationTime = c.DateTime(nullable: false),
  651. CreatorUserId = c.Long(),
  652. },
  653. annotations: new Dictionary<string, object>
  654. {
  655. { "DynamicFilter_SysState_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  656. })
  657. .PrimaryKey(t => t.Id)
  658. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  659. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  660. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  661. .Index(t => t.IsDeleted)
  662. .Index(t => t.DeleterUserId)
  663. .Index(t => t.LastModifierUserId)
  664. .Index(t => t.CreatorUserId);
  665. CreateTable(
  666. "dbo.Bs_TempInfos",
  667. c => new
  668. {
  669. Id = c.Int(nullable: false, identity: true),
  670. TableName = c.String(maxLength: 50),
  671. ColumnName = c.String(maxLength: 50),
  672. Key = c.String(maxLength: 50),
  673. Value1 = c.String(maxLength: 100),
  674. Value2 = c.String(maxLength: 200),
  675. Value3 = c.String(maxLength: 500),
  676. Value5 = c.String(maxLength: 500),
  677. Value6 = c.String(maxLength: 500),
  678. Value7 = c.String(maxLength: 500),
  679. Value8 = c.String(),
  680. CreationTime = c.DateTime(nullable: false),
  681. CreatorUserId = c.Long(),
  682. })
  683. .PrimaryKey(t => t.Id)
  684. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  685. .Index(t => t.CreatorUserId);
  686. CreateTable(
  687. "dbo.Sys_NotificationTenants",
  688. c => new
  689. {
  690. Id = c.Guid(nullable: false),
  691. TenantId = c.Int(),
  692. NotificationName = c.String(nullable: false, maxLength: 96),
  693. Data = c.String(),
  694. DataTypeName = c.String(maxLength: 512),
  695. EntityTypeName = c.String(maxLength: 250),
  696. EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
  697. EntityId = c.String(maxLength: 96),
  698. Severity = c.Byte(nullable: false),
  699. CreationTime = c.DateTime(nullable: false),
  700. CreatorUserId = c.Long(),
  701. },
  702. annotations: new Dictionary<string, object>
  703. {
  704. { "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  705. })
  706. .PrimaryKey(t => t.Id)
  707. .Index(t => t.TenantId);
  708. CreateTable(
  709. "dbo.Sys_Tenants",
  710. c => new
  711. {
  712. Id = c.Int(nullable: false, identity: true),
  713. TenancyName = c.String(nullable: false, maxLength: 64),
  714. Name = c.String(nullable: false, maxLength: 128),
  715. ConnectionString = c.String(maxLength: 1024),
  716. IsActive = c.Boolean(nullable: false),
  717. IsDeleted = c.Boolean(nullable: false),
  718. DeleterUserId = c.Long(),
  719. DeletionTime = c.DateTime(),
  720. LastModificationTime = c.DateTime(),
  721. LastModifierUserId = c.Long(),
  722. CreationTime = c.DateTime(nullable: false),
  723. CreatorUserId = c.Long(),
  724. },
  725. annotations: new Dictionary<string, object>
  726. {
  727. { "DynamicFilter_Tenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  728. })
  729. .PrimaryKey(t => t.Id)
  730. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  731. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  732. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  733. .Index(t => t.IsDeleted)
  734. .Index(t => t.DeleterUserId)
  735. .Index(t => t.LastModifierUserId)
  736. .Index(t => t.CreatorUserId);
  737. CreateTable(
  738. "dbo.Bs_TrainingRoles",
  739. c => new
  740. {
  741. Id = c.String(nullable: false, maxLength: 128),
  742. RoleName = c.String(maxLength: 50),
  743. Description = c.String(maxLength: 200),
  744. IsDeleted = c.Boolean(nullable: false),
  745. DeleterUserId = c.Long(),
  746. DeletionTime = c.DateTime(),
  747. LastModificationTime = c.DateTime(),
  748. LastModifierUserId = c.Long(),
  749. CreationTime = c.DateTime(nullable: false),
  750. CreatorUserId = c.Long(),
  751. },
  752. annotations: new Dictionary<string, object>
  753. {
  754. { "DynamicFilter_TrainingRoleInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  755. })
  756. .PrimaryKey(t => t.Id)
  757. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  758. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  759. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  760. .Index(t => t.IsDeleted)
  761. .Index(t => t.DeleterUserId)
  762. .Index(t => t.LastModifierUserId)
  763. .Index(t => t.CreatorUserId);
  764. CreateTable(
  765. "dbo.Sys_UserAccounts",
  766. c => new
  767. {
  768. Id = c.Long(nullable: false, identity: true),
  769. TenantId = c.Int(),
  770. UserId = c.Long(nullable: false),
  771. UserLinkId = c.Long(),
  772. UserName = c.String(maxLength: 256),
  773. EmailAddress = c.String(maxLength: 256),
  774. IsDeleted = c.Boolean(nullable: false),
  775. DeleterUserId = c.Long(),
  776. DeletionTime = c.DateTime(),
  777. LastModificationTime = c.DateTime(),
  778. LastModifierUserId = c.Long(),
  779. CreationTime = c.DateTime(nullable: false),
  780. CreatorUserId = c.Long(),
  781. },
  782. annotations: new Dictionary<string, object>
  783. {
  784. { "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  785. })
  786. .PrimaryKey(t => t.Id)
  787. .Index(t => t.IsDeleted);
  788. CreateTable(
  789. "dbo.Sys_UserLoginAttempts",
  790. c => new
  791. {
  792. Id = c.Long(nullable: false, identity: true),
  793. TenantId = c.Int(),
  794. TenancyName = c.String(maxLength: 64),
  795. UserId = c.Long(),
  796. UserNameOrEmailAddress = c.String(maxLength: 255),
  797. ClientIpAddress = c.String(maxLength: 64),
  798. ClientName = c.String(maxLength: 128),
  799. BrowserInfo = c.String(maxLength: 512),
  800. Result = c.Byte(nullable: false),
  801. CreationTime = c.DateTime(nullable: false),
  802. },
  803. annotations: new Dictionary<string, object>
  804. {
  805. { "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  806. })
  807. .PrimaryKey(t => t.Id)
  808. .Index(t => t.TenantId)
  809. .Index(t => new { t.UserId, t.TenantId })
  810. .Index(t => new { t.TenancyName, t.UserNameOrEmailAddress, t.Result });
  811. CreateTable(
  812. "dbo.Sys_NotificationUsers",
  813. c => new
  814. {
  815. Id = c.Guid(nullable: false),
  816. TenantId = c.Int(),
  817. UserId = c.Long(nullable: false),
  818. TenantNotificationId = c.Guid(nullable: false),
  819. State = c.Int(nullable: false),
  820. CreationTime = c.DateTime(nullable: false),
  821. },
  822. annotations: new Dictionary<string, object>
  823. {
  824. { "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  825. })
  826. .PrimaryKey(t => t.Id)
  827. .Index(t => t.TenantId)
  828. .Index(t => new { t.UserId, t.State, t.CreationTime });
  829. }
  830. public override void Down()
  831. {
  832. DropForeignKey("dbo.Bs_TrainingRoles", "LastModifierUserId", "dbo.Sys_Users");
  833. DropForeignKey("dbo.Bs_TrainingRoles", "DeleterUserId", "dbo.Sys_Users");
  834. DropForeignKey("dbo.Bs_TrainingRoles", "CreatorUserId", "dbo.Sys_Users");
  835. DropForeignKey("dbo.Sys_Tenants", "LastModifierUserId", "dbo.Sys_Users");
  836. DropForeignKey("dbo.Sys_Tenants", "DeleterUserId", "dbo.Sys_Users");
  837. DropForeignKey("dbo.Sys_Tenants", "CreatorUserId", "dbo.Sys_Users");
  838. DropForeignKey("dbo.Bs_TempInfos", "CreatorUserId", "dbo.Sys_Users");
  839. DropForeignKey("dbo.Sys_States", "LastModifierUserId", "dbo.Sys_Users");
  840. DropForeignKey("dbo.Sys_States", "DeleterUserId", "dbo.Sys_Users");
  841. DropForeignKey("dbo.Sys_States", "CreatorUserId", "dbo.Sys_Users");
  842. DropForeignKey("dbo.Sys_SysHelps", "LastModifierUserId", "dbo.Sys_Users");
  843. DropForeignKey("dbo.Sys_SysHelps", "DeleterUserId", "dbo.Sys_Users");
  844. DropForeignKey("dbo.Sys_SysHelps", "CreatorUserId", "dbo.Sys_Users");
  845. DropForeignKey("dbo.Sys_Functions", "LastModifierUserId", "dbo.Sys_Users");
  846. DropForeignKey("dbo.Sys_Functions", "DeleterUserId", "dbo.Sys_Users");
  847. DropForeignKey("dbo.Sys_Functions", "CreatorUserId", "dbo.Sys_Users");
  848. DropForeignKey("dbo.Sys_AttachFiles", "LastModifierUserId", "dbo.Sys_Users");
  849. DropForeignKey("dbo.Sys_AttachFiles", "DeleterUserId", "dbo.Sys_Users");
  850. DropForeignKey("dbo.Sys_AttachFiles", "CreatorUserId", "dbo.Sys_Users");
  851. DropForeignKey("dbo.Sys_Roles", "LastModifierUserId", "dbo.Sys_Users");
  852. DropForeignKey("dbo.Sys_Roles", "DeleterUserId", "dbo.Sys_Users");
  853. DropForeignKey("dbo.Sys_Roles", "CreatorUserId", "dbo.Sys_Users");
  854. DropForeignKey("dbo.Sys_RoleClaims", "RoleId", "dbo.Sys_Roles");
  855. DropForeignKey("dbo.Train_CampGroupScores", "CreatorUserId", "dbo.Sys_Users");
  856. DropForeignKey("dbo.Train_CampGroupScores", "GroupNo", "dbo.Train_CampGroups");
  857. DropForeignKey("dbo.Train_CampGroupLogs", "CreatorUserId", "dbo.Sys_Users");
  858. DropForeignKey("dbo.Train_CampGroupLogs", "GroupNo", "dbo.Train_CampGroups");
  859. DropForeignKey("dbo.Train_CampSceneMaps", "CreatorUserId", "dbo.Sys_Users");
  860. DropForeignKey("dbo.Train_CampSceneMaps", "CampNo", "dbo.Train_Camps");
  861. DropForeignKey("dbo.Train_CampRoleGroups", "RoleGroupNo", "dbo.Bs_TrainingRoleGroups");
  862. DropForeignKey("dbo.Bs_TrainingRoleGroups", "LastModifierUserId", "dbo.Sys_Users");
  863. DropForeignKey("dbo.Bs_TrainingRoleGroups", "DeleterUserId", "dbo.Sys_Users");
  864. DropForeignKey("dbo.Bs_TrainingRoleGroups", "CreatorUserId", "dbo.Sys_Users");
  865. DropForeignKey("dbo.Train_CampRoleGroups", "CreatorUserId", "dbo.Sys_Users");
  866. DropForeignKey("dbo.Train_CampRoleGroups", "CampNo", "dbo.Train_Camps");
  867. DropForeignKey("dbo.Train_CampGroups", "LastModifierUserId", "dbo.Sys_Users");
  868. DropForeignKey("dbo.Train_CampGroups", "DeleterUserId", "dbo.Sys_Users");
  869. DropForeignKey("dbo.Train_CampGroups", "CreatorUserId", "dbo.Sys_Users");
  870. DropForeignKey("dbo.Train_CampGroups", "CampNo", "dbo.Train_Camps");
  871. DropForeignKey("dbo.Train_BehaviorTags", "CreatorUserId", "dbo.Sys_Users");
  872. DropForeignKey("dbo.Train_BehaviorTags", "CampNo", "dbo.Train_Camps");
  873. DropForeignKey("dbo.Train_Camps", "LastModifierUserId", "dbo.Sys_Users");
  874. DropForeignKey("dbo.Train_Camps", "DeleterUserId", "dbo.Sys_Users");
  875. DropForeignKey("dbo.Train_Camps", "CreatorUserId", "dbo.Sys_Users");
  876. DropForeignKey("dbo.Sys_Settings", "UserId", "dbo.Sys_Users");
  877. DropForeignKey("dbo.Sys_UserRoles", "UserId", "dbo.Sys_Users");
  878. DropForeignKey("dbo.Sys_UserLogins", "UserId", "dbo.Sys_Users");
  879. DropForeignKey("dbo.Sys_Users", "LastModifierUserId", "dbo.Sys_Users");
  880. DropForeignKey("dbo.Sys_Users", "DeleterUserId", "dbo.Sys_Users");
  881. DropForeignKey("dbo.Sys_Users", "CreatorUserId", "dbo.Sys_Users");
  882. DropForeignKey("dbo.Sys_UserClaims", "UserId", "dbo.Sys_Users");
  883. DropIndex("dbo.Sys_NotificationUsers", new[] { "UserId", "State", "CreationTime" });
  884. DropIndex("dbo.Sys_NotificationUsers", new[] { "TenantId" });
  885. DropIndex("dbo.Sys_UserLoginAttempts", new[] { "TenancyName", "UserNameOrEmailAddress", "Result" });
  886. DropIndex("dbo.Sys_UserLoginAttempts", new[] { "UserId", "TenantId" });
  887. DropIndex("dbo.Sys_UserLoginAttempts", new[] { "TenantId" });
  888. DropIndex("dbo.Sys_UserAccounts", new[] { "IsDeleted" });
  889. DropIndex("dbo.Bs_TrainingRoles", new[] { "CreatorUserId" });
  890. DropIndex("dbo.Bs_TrainingRoles", new[] { "LastModifierUserId" });
  891. DropIndex("dbo.Bs_TrainingRoles", new[] { "DeleterUserId" });
  892. DropIndex("dbo.Bs_TrainingRoles", new[] { "IsDeleted" });
  893. DropIndex("dbo.Sys_Tenants", new[] { "CreatorUserId" });
  894. DropIndex("dbo.Sys_Tenants", new[] { "LastModifierUserId" });
  895. DropIndex("dbo.Sys_Tenants", new[] { "DeleterUserId" });
  896. DropIndex("dbo.Sys_Tenants", new[] { "IsDeleted" });
  897. DropIndex("dbo.Sys_NotificationTenants", new[] { "TenantId" });
  898. DropIndex("dbo.Bs_TempInfos", new[] { "CreatorUserId" });
  899. DropIndex("dbo.Sys_States", new[] { "CreatorUserId" });
  900. DropIndex("dbo.Sys_States", new[] { "LastModifierUserId" });
  901. DropIndex("dbo.Sys_States", new[] { "DeleterUserId" });
  902. DropIndex("dbo.Sys_States", new[] { "IsDeleted" });
  903. DropIndex("dbo.Sys_AuditLogs", new[] { "UserId" });
  904. DropIndex("dbo.Sys_AuditLogs", new[] { "TenantId" });
  905. DropIndex("dbo.Sys_SysHelps", new[] { "CreatorUserId" });
  906. DropIndex("dbo.Sys_SysHelps", new[] { "LastModifierUserId" });
  907. DropIndex("dbo.Sys_SysHelps", new[] { "DeleterUserId" });
  908. DropIndex("dbo.Sys_SysHelps", new[] { "IsDeleted" });
  909. DropIndex("dbo.Sys_Functions", new[] { "CreatorUserId" });
  910. DropIndex("dbo.Sys_Functions", new[] { "LastModifierUserId" });
  911. DropIndex("dbo.Sys_Functions", new[] { "DeleterUserId" });
  912. DropIndex("dbo.Sys_Functions", new[] { "IsDeleted" });
  913. DropIndex("dbo.Sys_Functions", new[] { "PermissionName" });
  914. DropIndex("dbo.Sys_Functions", new[] { "FunctionNo" });
  915. DropIndex("dbo.Sys_AttachFiles", new[] { "CreatorUserId" });
  916. DropIndex("dbo.Sys_AttachFiles", new[] { "LastModifierUserId" });
  917. DropIndex("dbo.Sys_AttachFiles", new[] { "DeleterUserId" });
  918. DropIndex("dbo.Sys_AttachFiles", new[] { "IsDeleted" });
  919. DropIndex("dbo.Sys_AttachFiles", new[] { "TenantId" });
  920. DropIndex("dbo.Sys_AppGuids", new[] { "IdType" });
  921. DropIndex("dbo.Sys_RoleClaims", new[] { "RoleId" });
  922. DropIndex("dbo.Sys_RoleClaims", new[] { "TenantId" });
  923. DropIndex("dbo.Sys_Roles", new[] { "CreatorUserId" });
  924. DropIndex("dbo.Sys_Roles", new[] { "LastModifierUserId" });
  925. DropIndex("dbo.Sys_Roles", new[] { "DeleterUserId" });
  926. DropIndex("dbo.Sys_Roles", new[] { "IsDeleted" });
  927. DropIndex("dbo.Sys_Roles", new[] { "AccountType" });
  928. DropIndex("dbo.Sys_Roles", new[] { "RoleType" });
  929. DropIndex("dbo.Sys_Roles", new[] { "Name" });
  930. DropIndex("dbo.Sys_Roles", new[] { "TenantId" });
  931. DropIndex("dbo.Sys_NotificationSubscriptions", new[] { "NotificationName", "EntityTypeName", "EntityId", "UserId" });
  932. DropIndex("dbo.Sys_NotificationSubscriptions", new[] { "TenantId" });
  933. DropIndex("dbo.Train_CampGroupScores", new[] { "CreatorUserId" });
  934. DropIndex("dbo.Train_CampGroupScores", new[] { "GroupNo" });
  935. DropIndex("dbo.Train_CampGroupLogs", new[] { "CreatorUserId" });
  936. DropIndex("dbo.Train_CampGroupLogs", new[] { "GroupNo" });
  937. DropIndex("dbo.Sys_Permissions", new[] { "TenantId" });
  938. DropIndex("dbo.Train_CampSceneMaps", new[] { "CreatorUserId" });
  939. DropIndex("dbo.Train_CampSceneMaps", new[] { "CampNo" });
  940. DropIndex("dbo.Bs_TrainingRoleGroups", new[] { "CreatorUserId" });
  941. DropIndex("dbo.Bs_TrainingRoleGroups", new[] { "LastModifierUserId" });
  942. DropIndex("dbo.Bs_TrainingRoleGroups", new[] { "DeleterUserId" });
  943. DropIndex("dbo.Bs_TrainingRoleGroups", new[] { "IsDeleted" });
  944. DropIndex("dbo.Train_CampRoleGroups", new[] { "CreatorUserId" });
  945. DropIndex("dbo.Train_CampRoleGroups", new[] { "CampNo" });
  946. DropIndex("dbo.Train_CampRoleGroups", new[] { "RoleGroupNo" });
  947. DropIndex("dbo.Train_CampGroups", new[] { "CreatorUserId" });
  948. DropIndex("dbo.Train_CampGroups", new[] { "LastModifierUserId" });
  949. DropIndex("dbo.Train_CampGroups", new[] { "DeleterUserId" });
  950. DropIndex("dbo.Train_CampGroups", new[] { "IsDeleted" });
  951. DropIndex("dbo.Train_CampGroups", new[] { "CampNo" });
  952. DropIndex("dbo.Sys_Settings", new[] { "TenantId", "Name", "UserId" });
  953. DropIndex("dbo.Sys_UserRoles", new[] { "UserId" });
  954. DropIndex("dbo.Sys_UserRoles", new[] { "TenantId" });
  955. DropIndex("dbo.Sys_UserLogins", new[] { "UserId" });
  956. DropIndex("dbo.Sys_UserLogins", new[] { "TenantId" });
  957. DropIndex("dbo.Sys_UserClaims", new[] { "UserId" });
  958. DropIndex("dbo.Sys_UserClaims", new[] { "TenantId" });
  959. DropIndex("dbo.Sys_Users", new[] { "CreatorUserId" });
  960. DropIndex("dbo.Sys_Users", new[] { "LastModifierUserId" });
  961. DropIndex("dbo.Sys_Users", new[] { "DeleterUserId" });
  962. DropIndex("dbo.Sys_Users", new[] { "IsDeleted" });
  963. DropIndex("dbo.Sys_Users", new[] { "PhoneNumber" });
  964. DropIndex("dbo.Sys_Users", new[] { "EmailAddress" });
  965. DropIndex("dbo.Sys_Users", new[] { "TenantId" });
  966. DropIndex("dbo.Sys_Users", new[] { "AccountType" });
  967. DropIndex("dbo.Sys_Users", new[] { "UserType" });
  968. DropIndex("dbo.Sys_Users", new[] { "UserName" });
  969. DropIndex("dbo.Train_Camps", new[] { "CreatorUserId" });
  970. DropIndex("dbo.Train_Camps", new[] { "LastModifierUserId" });
  971. DropIndex("dbo.Train_Camps", new[] { "DeleterUserId" });
  972. DropIndex("dbo.Train_Camps", new[] { "IsDeleted" });
  973. DropIndex("dbo.Train_BehaviorTags", new[] { "CreatorUserId" });
  974. DropIndex("dbo.Train_BehaviorTags", new[] { "CampNo" });
  975. DropTable("dbo.Sys_NotificationUsers",
  976. removedAnnotations: new Dictionary<string, object>
  977. {
  978. { "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  979. });
  980. DropTable("dbo.Sys_UserLoginAttempts",
  981. removedAnnotations: new Dictionary<string, object>
  982. {
  983. { "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  984. });
  985. DropTable("dbo.Sys_UserAccounts",
  986. removedAnnotations: new Dictionary<string, object>
  987. {
  988. { "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  989. });
  990. DropTable("dbo.Bs_TrainingRoles",
  991. removedAnnotations: new Dictionary<string, object>
  992. {
  993. { "DynamicFilter_TrainingRoleInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  994. });
  995. DropTable("dbo.Sys_Tenants",
  996. removedAnnotations: new Dictionary<string, object>
  997. {
  998. { "DynamicFilter_Tenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  999. });
  1000. DropTable("dbo.Sys_NotificationTenants",
  1001. removedAnnotations: new Dictionary<string, object>
  1002. {
  1003. { "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1004. });
  1005. DropTable("dbo.Bs_TempInfos");
  1006. DropTable("dbo.Sys_States",
  1007. removedAnnotations: new Dictionary<string, object>
  1008. {
  1009. { "DynamicFilter_SysState_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1010. });
  1011. DropTable("dbo.Sys_AuditLogs",
  1012. removedAnnotations: new Dictionary<string, object>
  1013. {
  1014. { "DynamicFilter_SysLog_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1015. });
  1016. DropTable("dbo.Sys_SysHelps",
  1017. removedAnnotations: new Dictionary<string, object>
  1018. {
  1019. { "DynamicFilter_SysHelp_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1020. });
  1021. DropTable("dbo.Sys_Functions",
  1022. removedAnnotations: new Dictionary<string, object>
  1023. {
  1024. { "DynamicFilter_SysFunction_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1025. });
  1026. DropTable("dbo.Sys_AttachFiles",
  1027. removedAnnotations: new Dictionary<string, object>
  1028. {
  1029. { "DynamicFilter_SysAttachFile_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1030. { "DynamicFilter_SysAttachFile_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1031. });
  1032. DropTable("dbo.Sys_AppGuids");
  1033. DropTable("dbo.Sys_RoleClaims",
  1034. removedAnnotations: new Dictionary<string, object>
  1035. {
  1036. { "DynamicFilter_RoleClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1037. });
  1038. DropTable("dbo.Sys_Roles",
  1039. removedAnnotations: new Dictionary<string, object>
  1040. {
  1041. { "DynamicFilter_Role_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1042. { "DynamicFilter_Role_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1043. });
  1044. DropTable("dbo.Sys_NotificationSubscriptions",
  1045. removedAnnotations: new Dictionary<string, object>
  1046. {
  1047. { "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1048. });
  1049. DropTable("dbo.Sys_Notifications");
  1050. DropTable("dbo.Train_CampGroupScores");
  1051. DropTable("dbo.Train_CampGroupLogs");
  1052. DropTable("dbo.Sys_Permissions",
  1053. removedAnnotations: new Dictionary<string, object>
  1054. {
  1055. { "DynamicFilter_DataPermission_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1056. { "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1057. { "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1058. { "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1059. });
  1060. DropTable("dbo.Train_CampSceneMaps");
  1061. DropTable("dbo.Bs_TrainingRoleGroups",
  1062. removedAnnotations: new Dictionary<string, object>
  1063. {
  1064. { "DynamicFilter_TrainingRoleGroupInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1065. });
  1066. DropTable("dbo.Train_CampRoleGroups");
  1067. DropTable("dbo.Train_CampGroups",
  1068. removedAnnotations: new Dictionary<string, object>
  1069. {
  1070. { "DynamicFilter_CampGroupInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1071. });
  1072. DropTable("dbo.Sys_Settings",
  1073. removedAnnotations: new Dictionary<string, object>
  1074. {
  1075. { "DynamicFilter_SysSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1076. });
  1077. DropTable("dbo.Sys_UserRoles",
  1078. removedAnnotations: new Dictionary<string, object>
  1079. {
  1080. { "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1081. });
  1082. DropTable("dbo.Sys_UserLogins",
  1083. removedAnnotations: new Dictionary<string, object>
  1084. {
  1085. { "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1086. });
  1087. DropTable("dbo.Sys_UserClaims",
  1088. removedAnnotations: new Dictionary<string, object>
  1089. {
  1090. { "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1091. });
  1092. DropTable("dbo.Sys_Users",
  1093. removedAnnotations: new Dictionary<string, object>
  1094. {
  1095. { "DynamicFilter_User_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1096. { "DynamicFilter_User_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1097. });
  1098. DropTable("dbo.Train_Camps",
  1099. removedAnnotations: new Dictionary<string, object>
  1100. {
  1101. { "DynamicFilter_CampInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1102. });
  1103. DropTable("dbo.Train_BehaviorTags");
  1104. }
  1105. }
  1106. }