202008050851223_InitCreate.cs 60 KB

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