202101191308418_InitCreate.cs 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370
  1. namespace ContractService.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.Cs_ClientCompanies",
  13. c => new
  14. {
  15. Id = c.String(nullable: false, maxLength: 128),
  16. Name = c.String(maxLength: 50),
  17. DisplayName = c.String(maxLength: 50),
  18. Description = c.String(maxLength: 500),
  19. Remark = c.String(maxLength: 1000),
  20. IsDeleted = c.Boolean(nullable: false),
  21. DeleterUserId = c.Long(),
  22. DeletionTime = c.DateTime(),
  23. LastModificationTime = c.DateTime(),
  24. LastModifierUserId = c.Long(),
  25. CreationTime = c.DateTime(nullable: false),
  26. CreatorUserId = c.Long(),
  27. },
  28. annotations: new Dictionary<string, object>
  29. {
  30. { "DynamicFilter_ClientCompanyInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  31. })
  32. .PrimaryKey(t => t.Id)
  33. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  34. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  35. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  36. .Index(t => t.IsDeleted)
  37. .Index(t => t.DeleterUserId)
  38. .Index(t => t.LastModifierUserId)
  39. .Index(t => t.CreatorUserId);
  40. CreateTable(
  41. "dbo.Sys_Users",
  42. c => new
  43. {
  44. Id = c.Long(nullable: false, identity: true),
  45. NormalizedUserName = c.String(nullable: false, maxLength: 256),
  46. NormalizedEmailAddress = c.String(nullable: false, maxLength: 256),
  47. ConcurrencyStamp = c.String(maxLength: 128),
  48. AuthenticationSource = c.String(maxLength: 64),
  49. UserName = c.String(nullable: false, maxLength: 256),
  50. UserType = c.Int(nullable: false),
  51. AccountType = c.Int(),
  52. AccountNo = c.String(maxLength: 100),
  53. ImagePath = c.String(maxLength: 1000),
  54. TenantId = c.Int(),
  55. EmailAddress = c.String(nullable: false, maxLength: 256),
  56. Name = c.String(nullable: false, maxLength: 64),
  57. Surname = c.String(maxLength: 64),
  58. AvatarImagePath = c.String(maxLength: 500),
  59. Password = c.String(nullable: false, maxLength: 128),
  60. EmailConfirmationCode = c.String(maxLength: 328),
  61. PasswordResetCode = c.String(maxLength: 328),
  62. LockoutEndDateUtc = c.DateTime(),
  63. AccessFailedCount = c.Int(nullable: false),
  64. IsLockoutEnabled = c.Boolean(nullable: false),
  65. PhoneNumber = c.String(maxLength: 32),
  66. IsPhoneNumberConfirmed = c.Boolean(nullable: false),
  67. SecurityStamp = c.String(maxLength: 128),
  68. IsTwoFactorEnabled = c.Boolean(nullable: false),
  69. IsEmailConfirmed = c.Boolean(nullable: false),
  70. IsActive = c.Boolean(nullable: false),
  71. IsDeleted = c.Boolean(nullable: false),
  72. DeleterUserId = c.Long(),
  73. DeletionTime = c.DateTime(),
  74. LastModificationTime = c.DateTime(),
  75. LastModifierUserId = c.Long(),
  76. CreationTime = c.DateTime(nullable: false),
  77. CreatorUserId = c.Long(),
  78. },
  79. annotations: new Dictionary<string, object>
  80. {
  81. { "DynamicFilter_User_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  82. { "DynamicFilter_User_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  83. })
  84. .PrimaryKey(t => t.Id)
  85. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  86. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  87. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  88. .Index(t => t.UserName)
  89. .Index(t => t.UserType)
  90. .Index(t => t.AccountType)
  91. .Index(t => t.TenantId)
  92. .Index(t => t.EmailAddress)
  93. .Index(t => t.PhoneNumber)
  94. .Index(t => t.IsDeleted)
  95. .Index(t => t.DeleterUserId)
  96. .Index(t => t.LastModifierUserId)
  97. .Index(t => t.CreatorUserId);
  98. CreateTable(
  99. "dbo.Sys_UserClaims",
  100. c => new
  101. {
  102. Id = c.Long(nullable: false, identity: true),
  103. TenantId = c.Int(),
  104. UserId = c.Long(nullable: false),
  105. ClaimType = c.String(maxLength: 256),
  106. ClaimValue = c.String(),
  107. CreationTime = c.DateTime(nullable: false),
  108. CreatorUserId = c.Long(),
  109. },
  110. annotations: new Dictionary<string, object>
  111. {
  112. { "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  113. })
  114. .PrimaryKey(t => t.Id)
  115. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  116. .Index(t => t.TenantId)
  117. .Index(t => t.UserId);
  118. CreateTable(
  119. "dbo.Sys_UserLogins",
  120. c => new
  121. {
  122. Id = c.Long(nullable: false, identity: true),
  123. TenantId = c.Int(),
  124. UserId = c.Long(nullable: false),
  125. LoginProvider = c.String(nullable: false, maxLength: 128),
  126. ProviderKey = c.String(nullable: false, maxLength: 256),
  127. },
  128. annotations: new Dictionary<string, object>
  129. {
  130. { "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  131. })
  132. .PrimaryKey(t => t.Id)
  133. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  134. .Index(t => t.TenantId)
  135. .Index(t => t.UserId);
  136. CreateTable(
  137. "dbo.Sys_UserRoles",
  138. c => new
  139. {
  140. Id = c.Long(nullable: false, identity: true),
  141. TenantId = c.Int(),
  142. UserId = c.Long(nullable: false),
  143. RoleId = c.Int(nullable: false),
  144. CreationTime = c.DateTime(nullable: false),
  145. CreatorUserId = c.Long(),
  146. },
  147. annotations: new Dictionary<string, object>
  148. {
  149. { "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  150. })
  151. .PrimaryKey(t => t.Id)
  152. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  153. .Index(t => t.TenantId)
  154. .Index(t => t.UserId);
  155. CreateTable(
  156. "dbo.Sys_Settings",
  157. c => new
  158. {
  159. Id = c.Long(nullable: false, identity: true),
  160. TenantId = c.Int(),
  161. UserId = c.Long(),
  162. Name = c.String(nullable: false, maxLength: 256),
  163. Value = c.String(),
  164. DisplayName = c.String(maxLength: 50),
  165. Type = c.Int(),
  166. Description = c.String(maxLength: 500),
  167. Remark = c.String(maxLength: 500),
  168. LastModificationTime = c.DateTime(),
  169. LastModifierUserId = c.Long(),
  170. CreationTime = c.DateTime(nullable: false),
  171. CreatorUserId = c.Long(),
  172. },
  173. annotations: new Dictionary<string, object>
  174. {
  175. { "DynamicFilter_SysSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  176. })
  177. .PrimaryKey(t => t.Id)
  178. .ForeignKey("dbo.Sys_Users", t => t.UserId)
  179. .Index(t => new { t.TenantId, t.Name, t.UserId }, unique: true);
  180. CreateTable(
  181. "dbo.Cs_ClientOrganizations",
  182. c => new
  183. {
  184. Id = c.String(nullable: false, maxLength: 128),
  185. ParentNo = c.String(maxLength: 128),
  186. Name = c.String(maxLength: 50),
  187. Description = c.String(maxLength: 500),
  188. Path = c.String(maxLength: 1000),
  189. Sort = c.Int(nullable: false),
  190. CompanyNo = c.String(maxLength: 128),
  191. CreationTime = c.DateTime(nullable: false),
  192. CreatorUserId = c.Long(),
  193. })
  194. .PrimaryKey(t => t.Id)
  195. .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo)
  196. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  197. .ForeignKey("dbo.Cs_ClientOrganizations", t => t.ParentNo)
  198. .Index(t => t.ParentNo)
  199. .Index(t => t.CompanyNo)
  200. .Index(t => t.CreatorUserId);
  201. CreateTable(
  202. "dbo.Cs_ClientStaffs",
  203. c => new
  204. {
  205. Id = c.String(nullable: false, maxLength: 128),
  206. Code = c.String(maxLength: 50),
  207. Name = c.String(maxLength: 50),
  208. Profile = c.String(maxLength: 500),
  209. Birthday = c.DateTime(),
  210. IdCard = c.String(maxLength: 20),
  211. PhoneNumber = c.String(maxLength: 20),
  212. PhoneNumber2 = c.String(maxLength: 20),
  213. UserName = c.String(maxLength: 20),
  214. CompanyNo = c.String(maxLength: 128),
  215. OrganizationNo = c.String(maxLength: 128),
  216. Email = c.String(maxLength: 50),
  217. Remark = c.String(maxLength: 1000),
  218. IsDeleted = c.Boolean(nullable: false),
  219. DeleterUserId = c.Long(),
  220. DeletionTime = c.DateTime(),
  221. LastModificationTime = c.DateTime(),
  222. LastModifierUserId = c.Long(),
  223. CreationTime = c.DateTime(nullable: false),
  224. CreatorUserId = c.Long(),
  225. },
  226. annotations: new Dictionary<string, object>
  227. {
  228. { "DynamicFilter_ClientStaffInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  229. })
  230. .PrimaryKey(t => t.Id)
  231. .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo)
  232. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  233. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  234. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  235. .ForeignKey("dbo.Cs_ClientOrganizations", t => t.OrganizationNo)
  236. .Index(t => t.CompanyNo)
  237. .Index(t => t.OrganizationNo)
  238. .Index(t => t.IsDeleted)
  239. .Index(t => t.DeleterUserId)
  240. .Index(t => t.LastModifierUserId)
  241. .Index(t => t.CreatorUserId);
  242. CreateTable(
  243. "dbo.Sys_Permissions",
  244. c => new
  245. {
  246. Id = c.Long(nullable: false, identity: true),
  247. TenantId = c.Int(),
  248. Name = c.String(nullable: false, maxLength: 500),
  249. Master = c.Int(),
  250. MasterValue = c.String(maxLength: 100),
  251. Access = c.Int(),
  252. AccessValue = c.String(maxLength: 500),
  253. IsGranted = c.Boolean(nullable: false),
  254. CreationTime = c.DateTime(nullable: false),
  255. CreatorUserId = c.Long(),
  256. UserId = c.Long(),
  257. Discriminator = c.String(nullable: false, maxLength: 128),
  258. },
  259. annotations: new Dictionary<string, object>
  260. {
  261. { "DynamicFilter_DataPermission_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  262. { "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  263. { "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  264. { "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  265. })
  266. .PrimaryKey(t => t.Id)
  267. .Index(t => t.TenantId);
  268. CreateTable(
  269. "dbo.Ls_LawFirms",
  270. c => new
  271. {
  272. Id = c.String(nullable: false, maxLength: 128),
  273. Name = c.String(maxLength: 50),
  274. DisplayName = c.String(maxLength: 50),
  275. Description = c.String(maxLength: 500),
  276. Remark = c.String(maxLength: 1000),
  277. IsDeleted = c.Boolean(nullable: false),
  278. DeleterUserId = c.Long(),
  279. DeletionTime = c.DateTime(),
  280. LastModificationTime = c.DateTime(),
  281. LastModifierUserId = c.Long(),
  282. CreationTime = c.DateTime(nullable: false),
  283. CreatorUserId = c.Long(),
  284. },
  285. annotations: new Dictionary<string, object>
  286. {
  287. { "DynamicFilter_LawFirmInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  288. })
  289. .PrimaryKey(t => t.Id)
  290. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  291. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  292. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  293. .Index(t => t.IsDeleted)
  294. .Index(t => t.DeleterUserId)
  295. .Index(t => t.LastModifierUserId)
  296. .Index(t => t.CreatorUserId);
  297. CreateTable(
  298. "dbo.Ls_Lawyers",
  299. c => new
  300. {
  301. Id = c.String(nullable: false, maxLength: 128),
  302. Code = c.String(maxLength: 50),
  303. Name = c.String(maxLength: 50),
  304. Profile = c.String(maxLength: 500),
  305. Email = c.String(maxLength: 50),
  306. Birthday = c.DateTime(),
  307. IdCard = c.String(maxLength: 20),
  308. PhoneNumber = c.String(maxLength: 20),
  309. PhoneNumber2 = c.String(maxLength: 20),
  310. UserName = c.String(maxLength: 20),
  311. Remark = c.String(maxLength: 1000),
  312. IsDeleted = c.Boolean(nullable: false),
  313. DeleterUserId = c.Long(),
  314. DeletionTime = c.DateTime(),
  315. LastModificationTime = c.DateTime(),
  316. LastModifierUserId = c.Long(),
  317. CreationTime = c.DateTime(nullable: false),
  318. CreatorUserId = c.Long(),
  319. },
  320. annotations: new Dictionary<string, object>
  321. {
  322. { "DynamicFilter_LawyerInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  323. })
  324. .PrimaryKey(t => t.Id)
  325. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  326. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  327. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  328. .Index(t => t.IsDeleted)
  329. .Index(t => t.DeleterUserId)
  330. .Index(t => t.LastModifierUserId)
  331. .Index(t => t.CreatorUserId);
  332. CreateTable(
  333. "dbo.Ls_LawyerRelatedInfos",
  334. c => new
  335. {
  336. Id = c.Int(nullable: false, identity: true),
  337. LawyerNo = c.String(nullable: false, maxLength: 128),
  338. RelatedType = c.Int(nullable: false),
  339. MasterType = c.Int(nullable: false),
  340. LawFirmNo = c.String(maxLength: 128),
  341. CaseNo = c.String(maxLength: 128),
  342. ContractNo = c.String(maxLength: 128),
  343. Remark = c.String(maxLength: 1000),
  344. CreationTime = c.DateTime(nullable: false),
  345. CreatorUserId = c.Long(),
  346. })
  347. .PrimaryKey(t => t.Id)
  348. .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo)
  349. .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo)
  350. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  351. .ForeignKey("dbo.Ls_LawFirms", t => t.LawFirmNo)
  352. .ForeignKey("dbo.Ls_Lawyers", t => t.LawyerNo)
  353. .Index(t => t.LawyerNo)
  354. .Index(t => t.RelatedType)
  355. .Index(t => t.MasterType)
  356. .Index(t => t.LawFirmNo)
  357. .Index(t => t.CaseNo)
  358. .Index(t => t.ContractNo)
  359. .Index(t => t.CreatorUserId);
  360. CreateTable(
  361. "dbo.Ls_LegalCases",
  362. c => new
  363. {
  364. Id = c.String(nullable: false, maxLength: 128),
  365. Code = c.String(maxLength: 50),
  366. Name = c.String(maxLength: 50),
  367. Tags = c.String(maxLength: 200),
  368. Description = c.String(maxLength: 500),
  369. ServiceLevel = c.Int(nullable: false),
  370. CaseState = c.Int(nullable: false),
  371. ServiceType = c.String(maxLength: 128),
  372. StartDateTime = c.DateTime(),
  373. EndDateTime = c.DateTime(),
  374. StateLastChangeTime = c.DateTime(),
  375. StateLastChangeCause = c.String(maxLength: 500),
  376. Remark = c.String(maxLength: 1000),
  377. CompanyNo = c.String(maxLength: 128),
  378. IsDeleted = c.Boolean(nullable: false),
  379. DeleterUserId = c.Long(),
  380. DeletionTime = c.DateTime(),
  381. LastModificationTime = c.DateTime(),
  382. LastModifierUserId = c.Long(),
  383. CreationTime = c.DateTime(nullable: false),
  384. CreatorUserId = c.Long(),
  385. },
  386. annotations: new Dictionary<string, object>
  387. {
  388. { "DynamicFilter_LegalCaseInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  389. })
  390. .PrimaryKey(t => t.Id)
  391. .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo)
  392. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  393. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  394. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  395. .ForeignKey("dbo.Base_LegalServiceTypes", t => t.ServiceType)
  396. .Index(t => t.ServiceType)
  397. .Index(t => t.CompanyNo)
  398. .Index(t => t.IsDeleted)
  399. .Index(t => t.DeleterUserId)
  400. .Index(t => t.LastModifierUserId)
  401. .Index(t => t.CreatorUserId);
  402. CreateTable(
  403. "dbo.Base_LegalServiceTypes",
  404. c => new
  405. {
  406. Id = c.String(nullable: false, maxLength: 128),
  407. ParentNo = c.String(maxLength: 128),
  408. Name = c.String(maxLength: 50),
  409. Description = c.String(maxLength: 500),
  410. ServiceTypePath = c.String(maxLength: 500),
  411. IsActive = c.Boolean(nullable: false),
  412. LastModificationTime = c.DateTime(),
  413. LastModifierUserId = c.Long(),
  414. CreationTime = c.DateTime(nullable: false),
  415. CreatorUserId = c.Long(),
  416. })
  417. .PrimaryKey(t => t.Id);
  418. CreateTable(
  419. "dbo.Ls_LegalContracts",
  420. c => new
  421. {
  422. Id = c.String(nullable: false, maxLength: 128),
  423. Code = c.String(maxLength: 50),
  424. Name = c.String(maxLength: 50),
  425. Tags = c.String(maxLength: 200),
  426. ContractState = c.Int(nullable: false),
  427. StartDateTime = c.DateTime(),
  428. EndDateTime = c.DateTime(),
  429. StateLastChangeTime = c.DateTime(),
  430. StateLastChangeCause = c.String(maxLength: 500),
  431. CaseNo = c.String(maxLength: 128),
  432. Remark = c.String(maxLength: 1000),
  433. IsDeleted = c.Boolean(nullable: false),
  434. DeleterUserId = c.Long(),
  435. DeletionTime = c.DateTime(),
  436. LastModificationTime = c.DateTime(),
  437. LastModifierUserId = c.Long(),
  438. CreationTime = c.DateTime(nullable: false),
  439. CreatorUserId = c.Long(),
  440. },
  441. annotations: new Dictionary<string, object>
  442. {
  443. { "DynamicFilter_LegalContractInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  444. })
  445. .PrimaryKey(t => t.Id)
  446. .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo)
  447. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  448. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  449. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  450. .Index(t => t.CaseNo)
  451. .Index(t => t.IsDeleted)
  452. .Index(t => t.DeleterUserId)
  453. .Index(t => t.LastModifierUserId)
  454. .Index(t => t.CreatorUserId);
  455. CreateTable(
  456. "dbo.Ls_LegalContractContents",
  457. c => new
  458. {
  459. Id = c.Long(nullable: false, identity: true),
  460. No = c.String(maxLength: 128),
  461. ContentInfo = c.String(),
  462. Remark = c.String(maxLength: 1000),
  463. CreationTime = c.DateTime(nullable: false),
  464. CreatorUserId = c.Long(),
  465. })
  466. .PrimaryKey(t => t.Id)
  467. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  468. .Index(t => t.CreatorUserId);
  469. CreateTable(
  470. "dbo.Ls_LegalContractKeyPoints",
  471. c => new
  472. {
  473. Id = c.String(nullable: false, maxLength: 128),
  474. ParentNo = c.String(maxLength: 128),
  475. Name = c.String(maxLength: 50),
  476. Tags = c.String(maxLength: 200),
  477. Description = c.String(maxLength: 500),
  478. KeyPointLevel = c.Int(nullable: false),
  479. KeyPointState = c.Int(nullable: false),
  480. ExpireDate = c.DateTime(),
  481. AlarmDate = c.DateTime(),
  482. ExecuteDate = c.DateTime(),
  483. ExpireDay = c.Int(nullable: false),
  484. AlarmDay = c.Int(nullable: false),
  485. KeyPointPath = c.String(maxLength: 500),
  486. ContractNo = c.String(maxLength: 128),
  487. Remark = c.String(maxLength: 1000),
  488. LastModificationTime = c.DateTime(),
  489. LastModifierUserId = c.Long(),
  490. CreationTime = c.DateTime(nullable: false),
  491. CreatorUserId = c.Long(),
  492. })
  493. .PrimaryKey(t => t.Id)
  494. .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo)
  495. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  496. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  497. .ForeignKey("dbo.Ls_LegalContractKeyPoints", t => t.ParentNo)
  498. .Index(t => t.ParentNo)
  499. .Index(t => t.ContractNo)
  500. .Index(t => t.LastModifierUserId)
  501. .Index(t => t.CreatorUserId);
  502. CreateTable(
  503. "dbo.Ls_LegalContractNotes",
  504. c => new
  505. {
  506. Id = c.Long(nullable: false, identity: true),
  507. ContractNo = c.String(maxLength: 128),
  508. KeyPointNo = c.String(maxLength: 128),
  509. IsLawyer = c.Boolean(nullable: false),
  510. NoteContent = c.String(maxLength: 1000),
  511. Remark = c.String(maxLength: 1000),
  512. CreationTime = c.DateTime(nullable: false),
  513. CreatorUserId = c.Long(),
  514. })
  515. .PrimaryKey(t => t.Id)
  516. .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo)
  517. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  518. .ForeignKey("dbo.Ls_LegalContractKeyPoints", t => t.KeyPointNo)
  519. .Index(t => t.ContractNo)
  520. .Index(t => t.KeyPointNo)
  521. .Index(t => t.CreatorUserId);
  522. CreateTable(
  523. "dbo.Ls_LegalContractSupplements",
  524. c => new
  525. {
  526. Id = c.String(nullable: false, maxLength: 128),
  527. Code = c.String(maxLength: 50),
  528. Name = c.String(maxLength: 50),
  529. ContractNo = c.String(maxLength: 128),
  530. Remark = c.String(maxLength: 1000),
  531. CreationTime = c.DateTime(nullable: false),
  532. CreatorUserId = c.Long(),
  533. })
  534. .PrimaryKey(t => t.Id)
  535. .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo)
  536. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  537. .Index(t => t.ContractNo)
  538. .Index(t => t.CreatorUserId);
  539. CreateTable(
  540. "dbo.Ls_LegalCaseNotes",
  541. c => new
  542. {
  543. Id = c.Long(nullable: false, identity: true),
  544. CaseNo = c.String(maxLength: 128),
  545. NoteContent = c.String(maxLength: 1000),
  546. Remark = c.String(maxLength: 1000),
  547. CreationTime = c.DateTime(nullable: false),
  548. CreatorUserId = c.Long(),
  549. })
  550. .PrimaryKey(t => t.Id)
  551. .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo)
  552. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  553. .Index(t => t.CaseNo)
  554. .Index(t => t.CreatorUserId);
  555. CreateTable(
  556. "dbo.Sys_Notifications",
  557. c => new
  558. {
  559. Id = c.Guid(nullable: false),
  560. NotificationName = c.String(nullable: false, maxLength: 96),
  561. Data = c.String(),
  562. DataTypeName = c.String(maxLength: 512),
  563. EntityTypeName = c.String(maxLength: 250),
  564. EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
  565. EntityId = c.String(maxLength: 96),
  566. Severity = c.Byte(nullable: false),
  567. UserIds = c.String(),
  568. ExcludedUserIds = c.String(),
  569. TenantIds = c.String(),
  570. CreationTime = c.DateTime(nullable: false),
  571. CreatorUserId = c.Long(),
  572. })
  573. .PrimaryKey(t => t.Id);
  574. CreateTable(
  575. "dbo.Sys_NotificationSubscriptions",
  576. c => new
  577. {
  578. Id = c.Guid(nullable: false),
  579. TenantId = c.Int(),
  580. UserId = c.Long(nullable: false),
  581. NotificationName = c.String(maxLength: 96),
  582. EntityTypeName = c.String(maxLength: 250),
  583. EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
  584. EntityId = c.String(maxLength: 96),
  585. CreationTime = c.DateTime(nullable: false),
  586. CreatorUserId = c.Long(),
  587. },
  588. annotations: new Dictionary<string, object>
  589. {
  590. { "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  591. })
  592. .PrimaryKey(t => t.Id)
  593. .Index(t => t.TenantId)
  594. .Index(t => new { t.NotificationName, t.EntityTypeName, t.EntityId, t.UserId });
  595. CreateTable(
  596. "dbo.Sys_Roles",
  597. c => new
  598. {
  599. Id = c.Int(nullable: false, identity: true),
  600. Description = c.String(),
  601. NormalizedName = c.String(nullable: false, maxLength: 32),
  602. ConcurrencyStamp = c.String(maxLength: 128),
  603. TenantId = c.Int(),
  604. Name = c.String(nullable: false, maxLength: 32),
  605. RoleType = c.Int(nullable: false),
  606. AccountType = c.Int(),
  607. DisplayName = c.String(nullable: false, maxLength: 64),
  608. IsStatic = c.Boolean(nullable: false),
  609. IsDefault = c.Boolean(nullable: false),
  610. IsDeleted = c.Boolean(nullable: false),
  611. DeleterUserId = c.Long(),
  612. DeletionTime = c.DateTime(),
  613. LastModificationTime = c.DateTime(),
  614. LastModifierUserId = c.Long(),
  615. CreationTime = c.DateTime(nullable: false),
  616. CreatorUserId = c.Long(),
  617. },
  618. annotations: new Dictionary<string, object>
  619. {
  620. { "DynamicFilter_Role_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  621. { "DynamicFilter_Role_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  622. })
  623. .PrimaryKey(t => t.Id)
  624. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  625. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  626. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  627. .Index(t => t.TenantId)
  628. .Index(t => t.Name)
  629. .Index(t => t.RoleType)
  630. .Index(t => t.AccountType)
  631. .Index(t => t.IsDeleted)
  632. .Index(t => t.DeleterUserId)
  633. .Index(t => t.LastModifierUserId)
  634. .Index(t => t.CreatorUserId);
  635. CreateTable(
  636. "dbo.Sys_RoleClaims",
  637. c => new
  638. {
  639. Id = c.Long(nullable: false, identity: true),
  640. TenantId = c.Int(),
  641. RoleId = c.Int(nullable: false),
  642. ClaimType = c.String(maxLength: 256),
  643. ClaimValue = c.String(),
  644. CreationTime = c.DateTime(nullable: false),
  645. CreatorUserId = c.Long(),
  646. },
  647. annotations: new Dictionary<string, object>
  648. {
  649. { "DynamicFilter_RoleClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  650. })
  651. .PrimaryKey(t => t.Id)
  652. .ForeignKey("dbo.Sys_Roles", t => t.RoleId)
  653. .Index(t => t.TenantId)
  654. .Index(t => t.RoleId);
  655. CreateTable(
  656. "dbo.Cs_StaffRelateInfos",
  657. c => new
  658. {
  659. Id = c.Int(nullable: false, identity: true),
  660. StaffNo = c.String(maxLength: 128),
  661. CompanyNo = c.String(maxLength: 128),
  662. CaseNo = c.String(maxLength: 128),
  663. ContractNo = c.String(maxLength: 128),
  664. RelatedType = c.Int(nullable: false),
  665. MasterType = c.Int(nullable: false),
  666. CreationTime = c.DateTime(nullable: false),
  667. CreatorUserId = c.Long(),
  668. })
  669. .PrimaryKey(t => t.Id)
  670. .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo)
  671. .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo)
  672. .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo)
  673. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  674. .ForeignKey("dbo.Cs_ClientStaffs", t => t.StaffNo)
  675. .Index(t => t.StaffNo)
  676. .Index(t => t.CompanyNo)
  677. .Index(t => t.CaseNo)
  678. .Index(t => t.ContractNo)
  679. .Index(t => t.CreatorUserId);
  680. CreateTable(
  681. "dbo.Sys_AppGuids",
  682. c => new
  683. {
  684. Id = c.Int(nullable: false, identity: true),
  685. Step = c.Short(nullable: false),
  686. LastId = c.Int(nullable: false),
  687. IdType = c.Short(nullable: false),
  688. LastUseDate = c.DateTime(),
  689. })
  690. .PrimaryKey(t => t.Id)
  691. .Index(t => t.IdType);
  692. CreateTable(
  693. "dbo.Sys_AttachFiles",
  694. c => new
  695. {
  696. Id = c.Int(nullable: false, identity: true),
  697. AttachNo = c.String(maxLength: 32),
  698. TableName = c.String(maxLength: 50),
  699. ColumnName = c.String(maxLength: 50),
  700. SourceKey = c.String(maxLength: 50),
  701. FileTitle = c.String(maxLength: 50),
  702. FileName = c.String(maxLength: 50),
  703. FilePath = c.String(maxLength: 500),
  704. FileType = c.String(maxLength: 20),
  705. FileExt = c.String(maxLength: 10),
  706. Description = c.String(maxLength: 500),
  707. TenantId = c.Int(nullable: false),
  708. CreationTime = c.DateTime(nullable: false),
  709. CreatorUserId = c.Long(),
  710. },
  711. annotations: new Dictionary<string, object>
  712. {
  713. { "DynamicFilter_SysAttachFile_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  714. })
  715. .PrimaryKey(t => t.Id)
  716. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  717. .Index(t => t.TenantId)
  718. .Index(t => t.CreatorUserId);
  719. CreateTable(
  720. "dbo.Sys_Functions",
  721. c => new
  722. {
  723. Id = c.Int(nullable: false, identity: true),
  724. FunctionNo = c.String(maxLength: 100),
  725. ParentNo = c.String(maxLength: 100),
  726. FunctionName = c.String(maxLength: 100),
  727. PermissionName = c.String(maxLength: 500),
  728. FunctionType = c.Int(nullable: false),
  729. Action = c.String(maxLength: 50),
  730. Controller = c.String(maxLength: 50),
  731. Url = c.String(),
  732. Icon = c.String(maxLength: 20),
  733. Class = c.String(maxLength: 100),
  734. Script = c.String(),
  735. NeedAuth = c.Boolean(nullable: false),
  736. Sort = c.Int(nullable: false),
  737. Depth = c.Int(nullable: false),
  738. IsLeaf = c.Boolean(),
  739. IsDeleted = c.Boolean(nullable: false),
  740. DeleterUserId = c.Long(),
  741. DeletionTime = c.DateTime(),
  742. LastModificationTime = c.DateTime(),
  743. LastModifierUserId = c.Long(),
  744. CreationTime = c.DateTime(nullable: false),
  745. CreatorUserId = c.Long(),
  746. },
  747. annotations: new Dictionary<string, object>
  748. {
  749. { "DynamicFilter_SysFunction_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  750. })
  751. .PrimaryKey(t => t.Id)
  752. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  753. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  754. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  755. .Index(t => t.FunctionNo)
  756. .Index(t => t.PermissionName, unique: true)
  757. .Index(t => t.IsDeleted)
  758. .Index(t => t.DeleterUserId)
  759. .Index(t => t.LastModifierUserId)
  760. .Index(t => t.CreatorUserId);
  761. CreateTable(
  762. "dbo.Sys_SysHelps",
  763. c => new
  764. {
  765. Id = c.Int(nullable: false, identity: true),
  766. Classification = c.String(maxLength: 40),
  767. HelpTitle = c.String(nullable: false, maxLength: 50),
  768. HelpKeyWords = c.String(maxLength: 50),
  769. HelpContent = c.String(),
  770. FunctionNo = c.String(maxLength: 100),
  771. PermissionName = c.String(maxLength: 500),
  772. Sequence = c.Int(nullable: false),
  773. Description = c.String(),
  774. Remark = c.String(maxLength: 1000),
  775. IsDeleted = c.Boolean(nullable: false),
  776. DeleterUserId = c.Long(),
  777. DeletionTime = c.DateTime(),
  778. LastModificationTime = c.DateTime(),
  779. LastModifierUserId = c.Long(),
  780. CreationTime = c.DateTime(nullable: false),
  781. CreatorUserId = c.Long(),
  782. },
  783. annotations: new Dictionary<string, object>
  784. {
  785. { "DynamicFilter_SysHelp_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  786. })
  787. .PrimaryKey(t => t.Id)
  788. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  789. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  790. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  791. .Index(t => t.IsDeleted)
  792. .Index(t => t.DeleterUserId)
  793. .Index(t => t.LastModifierUserId)
  794. .Index(t => t.CreatorUserId);
  795. CreateTable(
  796. "dbo.Sys_AuditLogs",
  797. c => new
  798. {
  799. Id = c.Long(nullable: false, identity: true),
  800. TenantId = c.Int(nullable: false),
  801. UserId = c.Long(),
  802. UserName = c.String(),
  803. ServiceName = c.String(maxLength: 256),
  804. ServiceNameLang = c.String(),
  805. MethodName = c.String(maxLength: 256),
  806. MethodNameLang = c.String(),
  807. Parameters = c.String(maxLength: 1024),
  808. ExecutionTime = c.DateTime(nullable: false),
  809. ExecutionDuration = c.Int(nullable: false),
  810. ClientIpAddress = c.String(maxLength: 64),
  811. ClientName = c.String(maxLength: 128),
  812. BrowserInfo = c.String(maxLength: 512),
  813. Exception = c.String(maxLength: 2000),
  814. ImpersonatorUserId = c.Long(),
  815. ImpersonatorTenantId = c.Int(),
  816. CustomData = c.String(maxLength: 2000),
  817. LogType = c.Int(nullable: false),
  818. },
  819. annotations: new Dictionary<string, object>
  820. {
  821. { "DynamicFilter_SysLog_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  822. })
  823. .PrimaryKey(t => t.Id)
  824. .Index(t => t.TenantId)
  825. .Index(t => t.UserId);
  826. CreateTable(
  827. "dbo.Sys_QueryInfos",
  828. c => new
  829. {
  830. Id = c.Int(nullable: false, identity: true),
  831. TableKey = c.String(maxLength: 30),
  832. ColumnKey = c.String(maxLength: 30),
  833. ValueKey = c.String(maxLength: 100),
  834. NameKey = c.String(maxLength: 100),
  835. UseCount = c.Int(nullable: false),
  836. LastUseDate = c.DateTime(nullable: false),
  837. ExtensionData = c.String(),
  838. Remark = c.String(maxLength: 500),
  839. })
  840. .PrimaryKey(t => t.Id)
  841. .Index(t => t.TableKey)
  842. .Index(t => t.ColumnKey)
  843. .Index(t => t.ValueKey)
  844. .Index(t => t.NameKey);
  845. CreateTable(
  846. "dbo.Sys_States",
  847. c => new
  848. {
  849. Id = c.Int(nullable: false, identity: true),
  850. StateNo = c.String(maxLength: 32),
  851. StateName = c.String(maxLength: 50),
  852. TableName = c.String(nullable: false, maxLength: 50),
  853. ColumnName = c.String(nullable: false, maxLength: 50),
  854. CodeValue = c.String(nullable: false, maxLength: 100),
  855. DisplayValue = c.String(nullable: false, maxLength: 100),
  856. IsDeleted = c.Boolean(nullable: false),
  857. DeleterUserId = c.Long(),
  858. DeletionTime = c.DateTime(),
  859. LastModificationTime = c.DateTime(),
  860. LastModifierUserId = c.Long(),
  861. CreationTime = c.DateTime(nullable: false),
  862. CreatorUserId = c.Long(),
  863. },
  864. annotations: new Dictionary<string, object>
  865. {
  866. { "DynamicFilter_SysState_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  867. })
  868. .PrimaryKey(t => t.Id)
  869. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  870. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  871. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  872. .Index(t => t.IsDeleted)
  873. .Index(t => t.DeleterUserId)
  874. .Index(t => t.LastModifierUserId)
  875. .Index(t => t.CreatorUserId);
  876. CreateTable(
  877. "dbo.Sys_NotificationTenants",
  878. c => new
  879. {
  880. Id = c.Guid(nullable: false),
  881. TenantId = c.Int(),
  882. NotificationName = c.String(nullable: false, maxLength: 96),
  883. Data = c.String(),
  884. DataTypeName = c.String(maxLength: 512),
  885. EntityTypeName = c.String(maxLength: 250),
  886. EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
  887. EntityId = c.String(maxLength: 96),
  888. Severity = c.Byte(nullable: false),
  889. CreationTime = c.DateTime(nullable: false),
  890. CreatorUserId = c.Long(),
  891. },
  892. annotations: new Dictionary<string, object>
  893. {
  894. { "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  895. })
  896. .PrimaryKey(t => t.Id)
  897. .Index(t => t.TenantId);
  898. CreateTable(
  899. "dbo.Sys_Tenants",
  900. c => new
  901. {
  902. Id = c.Int(nullable: false, identity: true),
  903. TenancyName = c.String(nullable: false, maxLength: 64),
  904. Name = c.String(nullable: false, maxLength: 128),
  905. ConnectionString = c.String(maxLength: 1024),
  906. IsActive = c.Boolean(nullable: false),
  907. IsDeleted = c.Boolean(nullable: false),
  908. DeleterUserId = c.Long(),
  909. DeletionTime = c.DateTime(),
  910. LastModificationTime = c.DateTime(),
  911. LastModifierUserId = c.Long(),
  912. CreationTime = c.DateTime(nullable: false),
  913. CreatorUserId = c.Long(),
  914. },
  915. annotations: new Dictionary<string, object>
  916. {
  917. { "DynamicFilter_Tenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  918. })
  919. .PrimaryKey(t => t.Id)
  920. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  921. .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
  922. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  923. .Index(t => t.IsDeleted)
  924. .Index(t => t.DeleterUserId)
  925. .Index(t => t.LastModifierUserId)
  926. .Index(t => t.CreatorUserId);
  927. CreateTable(
  928. "dbo.Sys_UserAccounts",
  929. c => new
  930. {
  931. Id = c.Long(nullable: false, identity: true),
  932. TenantId = c.Int(),
  933. UserId = c.Long(nullable: false),
  934. UserLinkId = c.Long(),
  935. UserName = c.String(maxLength: 256),
  936. EmailAddress = c.String(maxLength: 256),
  937. IsDeleted = c.Boolean(nullable: false),
  938. DeleterUserId = c.Long(),
  939. DeletionTime = c.DateTime(),
  940. LastModificationTime = c.DateTime(),
  941. LastModifierUserId = c.Long(),
  942. CreationTime = c.DateTime(nullable: false),
  943. CreatorUserId = c.Long(),
  944. },
  945. annotations: new Dictionary<string, object>
  946. {
  947. { "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  948. })
  949. .PrimaryKey(t => t.Id)
  950. .Index(t => t.IsDeleted);
  951. CreateTable(
  952. "dbo.Sys_UserLoginAttempts",
  953. c => new
  954. {
  955. Id = c.Long(nullable: false, identity: true),
  956. TenantId = c.Int(),
  957. TenancyName = c.String(maxLength: 64),
  958. UserId = c.Long(),
  959. UserNameOrEmailAddress = c.String(maxLength: 255),
  960. ClientIpAddress = c.String(maxLength: 64),
  961. ClientName = c.String(maxLength: 128),
  962. BrowserInfo = c.String(maxLength: 512),
  963. Result = c.Byte(nullable: false),
  964. CreationTime = c.DateTime(nullable: false),
  965. },
  966. annotations: new Dictionary<string, object>
  967. {
  968. { "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  969. })
  970. .PrimaryKey(t => t.Id)
  971. .Index(t => t.TenantId)
  972. .Index(t => new { t.UserId, t.TenantId })
  973. .Index(t => new { t.TenancyName, t.UserNameOrEmailAddress, t.Result });
  974. CreateTable(
  975. "dbo.Sys_NotificationUsers",
  976. c => new
  977. {
  978. Id = c.Guid(nullable: false),
  979. TenantId = c.Int(),
  980. UserId = c.Long(nullable: false),
  981. TenantNotificationId = c.Guid(nullable: false),
  982. State = c.Int(nullable: false),
  983. CreationTime = c.DateTime(nullable: false),
  984. },
  985. annotations: new Dictionary<string, object>
  986. {
  987. { "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  988. })
  989. .PrimaryKey(t => t.Id)
  990. .Index(t => t.TenantId)
  991. .Index(t => new { t.UserId, t.State, t.CreationTime });
  992. }
  993. public override void Down()
  994. {
  995. DropForeignKey("dbo.Sys_Tenants", "LastModifierUserId", "dbo.Sys_Users");
  996. DropForeignKey("dbo.Sys_Tenants", "DeleterUserId", "dbo.Sys_Users");
  997. DropForeignKey("dbo.Sys_Tenants", "CreatorUserId", "dbo.Sys_Users");
  998. DropForeignKey("dbo.Sys_States", "LastModifierUserId", "dbo.Sys_Users");
  999. DropForeignKey("dbo.Sys_States", "DeleterUserId", "dbo.Sys_Users");
  1000. DropForeignKey("dbo.Sys_States", "CreatorUserId", "dbo.Sys_Users");
  1001. DropForeignKey("dbo.Sys_SysHelps", "LastModifierUserId", "dbo.Sys_Users");
  1002. DropForeignKey("dbo.Sys_SysHelps", "DeleterUserId", "dbo.Sys_Users");
  1003. DropForeignKey("dbo.Sys_SysHelps", "CreatorUserId", "dbo.Sys_Users");
  1004. DropForeignKey("dbo.Sys_Functions", "LastModifierUserId", "dbo.Sys_Users");
  1005. DropForeignKey("dbo.Sys_Functions", "DeleterUserId", "dbo.Sys_Users");
  1006. DropForeignKey("dbo.Sys_Functions", "CreatorUserId", "dbo.Sys_Users");
  1007. DropForeignKey("dbo.Sys_AttachFiles", "CreatorUserId", "dbo.Sys_Users");
  1008. DropForeignKey("dbo.Cs_StaffRelateInfos", "StaffNo", "dbo.Cs_ClientStaffs");
  1009. DropForeignKey("dbo.Cs_StaffRelateInfos", "CreatorUserId", "dbo.Sys_Users");
  1010. DropForeignKey("dbo.Cs_StaffRelateInfos", "ContractNo", "dbo.Ls_LegalContracts");
  1011. DropForeignKey("dbo.Cs_StaffRelateInfos", "CompanyNo", "dbo.Cs_ClientCompanies");
  1012. DropForeignKey("dbo.Cs_StaffRelateInfos", "CaseNo", "dbo.Ls_LegalCases");
  1013. DropForeignKey("dbo.Sys_Roles", "LastModifierUserId", "dbo.Sys_Users");
  1014. DropForeignKey("dbo.Sys_Roles", "DeleterUserId", "dbo.Sys_Users");
  1015. DropForeignKey("dbo.Sys_Roles", "CreatorUserId", "dbo.Sys_Users");
  1016. DropForeignKey("dbo.Sys_RoleClaims", "RoleId", "dbo.Sys_Roles");
  1017. DropForeignKey("dbo.Ls_LegalCaseNotes", "CreatorUserId", "dbo.Sys_Users");
  1018. DropForeignKey("dbo.Ls_LegalCaseNotes", "CaseNo", "dbo.Ls_LegalCases");
  1019. DropForeignKey("dbo.Ls_LegalContractSupplements", "CreatorUserId", "dbo.Sys_Users");
  1020. DropForeignKey("dbo.Ls_LegalContractSupplements", "ContractNo", "dbo.Ls_LegalContracts");
  1021. DropForeignKey("dbo.Ls_LegalContractNotes", "KeyPointNo", "dbo.Ls_LegalContractKeyPoints");
  1022. DropForeignKey("dbo.Ls_LegalContractNotes", "CreatorUserId", "dbo.Sys_Users");
  1023. DropForeignKey("dbo.Ls_LegalContractNotes", "ContractNo", "dbo.Ls_LegalContracts");
  1024. DropForeignKey("dbo.Ls_LegalContractKeyPoints", "ParentNo", "dbo.Ls_LegalContractKeyPoints");
  1025. DropForeignKey("dbo.Ls_LegalContractKeyPoints", "LastModifierUserId", "dbo.Sys_Users");
  1026. DropForeignKey("dbo.Ls_LegalContractKeyPoints", "CreatorUserId", "dbo.Sys_Users");
  1027. DropForeignKey("dbo.Ls_LegalContractKeyPoints", "ContractNo", "dbo.Ls_LegalContracts");
  1028. DropForeignKey("dbo.Ls_LegalContractContents", "CreatorUserId", "dbo.Sys_Users");
  1029. DropForeignKey("dbo.Ls_LawyerRelatedInfos", "LawyerNo", "dbo.Ls_Lawyers");
  1030. DropForeignKey("dbo.Ls_LawyerRelatedInfos", "LawFirmNo", "dbo.Ls_LawFirms");
  1031. DropForeignKey("dbo.Ls_LawyerRelatedInfos", "CreatorUserId", "dbo.Sys_Users");
  1032. DropForeignKey("dbo.Ls_LawyerRelatedInfos", "ContractNo", "dbo.Ls_LegalContracts");
  1033. DropForeignKey("dbo.Ls_LegalContracts", "LastModifierUserId", "dbo.Sys_Users");
  1034. DropForeignKey("dbo.Ls_LegalContracts", "DeleterUserId", "dbo.Sys_Users");
  1035. DropForeignKey("dbo.Ls_LegalContracts", "CreatorUserId", "dbo.Sys_Users");
  1036. DropForeignKey("dbo.Ls_LegalContracts", "CaseNo", "dbo.Ls_LegalCases");
  1037. DropForeignKey("dbo.Ls_LawyerRelatedInfos", "CaseNo", "dbo.Ls_LegalCases");
  1038. DropForeignKey("dbo.Ls_LegalCases", "ServiceType", "dbo.Base_LegalServiceTypes");
  1039. DropForeignKey("dbo.Ls_LegalCases", "LastModifierUserId", "dbo.Sys_Users");
  1040. DropForeignKey("dbo.Ls_LegalCases", "DeleterUserId", "dbo.Sys_Users");
  1041. DropForeignKey("dbo.Ls_LegalCases", "CreatorUserId", "dbo.Sys_Users");
  1042. DropForeignKey("dbo.Ls_LegalCases", "CompanyNo", "dbo.Cs_ClientCompanies");
  1043. DropForeignKey("dbo.Ls_Lawyers", "LastModifierUserId", "dbo.Sys_Users");
  1044. DropForeignKey("dbo.Ls_Lawyers", "DeleterUserId", "dbo.Sys_Users");
  1045. DropForeignKey("dbo.Ls_Lawyers", "CreatorUserId", "dbo.Sys_Users");
  1046. DropForeignKey("dbo.Ls_LawFirms", "LastModifierUserId", "dbo.Sys_Users");
  1047. DropForeignKey("dbo.Ls_LawFirms", "DeleterUserId", "dbo.Sys_Users");
  1048. DropForeignKey("dbo.Ls_LawFirms", "CreatorUserId", "dbo.Sys_Users");
  1049. DropForeignKey("dbo.Cs_ClientStaffs", "OrganizationNo", "dbo.Cs_ClientOrganizations");
  1050. DropForeignKey("dbo.Cs_ClientStaffs", "LastModifierUserId", "dbo.Sys_Users");
  1051. DropForeignKey("dbo.Cs_ClientStaffs", "DeleterUserId", "dbo.Sys_Users");
  1052. DropForeignKey("dbo.Cs_ClientStaffs", "CreatorUserId", "dbo.Sys_Users");
  1053. DropForeignKey("dbo.Cs_ClientStaffs", "CompanyNo", "dbo.Cs_ClientCompanies");
  1054. DropForeignKey("dbo.Cs_ClientOrganizations", "ParentNo", "dbo.Cs_ClientOrganizations");
  1055. DropForeignKey("dbo.Cs_ClientOrganizations", "CreatorUserId", "dbo.Sys_Users");
  1056. DropForeignKey("dbo.Cs_ClientOrganizations", "CompanyNo", "dbo.Cs_ClientCompanies");
  1057. DropForeignKey("dbo.Cs_ClientCompanies", "LastModifierUserId", "dbo.Sys_Users");
  1058. DropForeignKey("dbo.Cs_ClientCompanies", "DeleterUserId", "dbo.Sys_Users");
  1059. DropForeignKey("dbo.Cs_ClientCompanies", "CreatorUserId", "dbo.Sys_Users");
  1060. DropForeignKey("dbo.Sys_Settings", "UserId", "dbo.Sys_Users");
  1061. DropForeignKey("dbo.Sys_UserRoles", "UserId", "dbo.Sys_Users");
  1062. DropForeignKey("dbo.Sys_UserLogins", "UserId", "dbo.Sys_Users");
  1063. DropForeignKey("dbo.Sys_Users", "LastModifierUserId", "dbo.Sys_Users");
  1064. DropForeignKey("dbo.Sys_Users", "DeleterUserId", "dbo.Sys_Users");
  1065. DropForeignKey("dbo.Sys_Users", "CreatorUserId", "dbo.Sys_Users");
  1066. DropForeignKey("dbo.Sys_UserClaims", "UserId", "dbo.Sys_Users");
  1067. DropIndex("dbo.Sys_NotificationUsers", new[] { "UserId", "State", "CreationTime" });
  1068. DropIndex("dbo.Sys_NotificationUsers", new[] { "TenantId" });
  1069. DropIndex("dbo.Sys_UserLoginAttempts", new[] { "TenancyName", "UserNameOrEmailAddress", "Result" });
  1070. DropIndex("dbo.Sys_UserLoginAttempts", new[] { "UserId", "TenantId" });
  1071. DropIndex("dbo.Sys_UserLoginAttempts", new[] { "TenantId" });
  1072. DropIndex("dbo.Sys_UserAccounts", new[] { "IsDeleted" });
  1073. DropIndex("dbo.Sys_Tenants", new[] { "CreatorUserId" });
  1074. DropIndex("dbo.Sys_Tenants", new[] { "LastModifierUserId" });
  1075. DropIndex("dbo.Sys_Tenants", new[] { "DeleterUserId" });
  1076. DropIndex("dbo.Sys_Tenants", new[] { "IsDeleted" });
  1077. DropIndex("dbo.Sys_NotificationTenants", new[] { "TenantId" });
  1078. DropIndex("dbo.Sys_States", new[] { "CreatorUserId" });
  1079. DropIndex("dbo.Sys_States", new[] { "LastModifierUserId" });
  1080. DropIndex("dbo.Sys_States", new[] { "DeleterUserId" });
  1081. DropIndex("dbo.Sys_States", new[] { "IsDeleted" });
  1082. DropIndex("dbo.Sys_QueryInfos", new[] { "NameKey" });
  1083. DropIndex("dbo.Sys_QueryInfos", new[] { "ValueKey" });
  1084. DropIndex("dbo.Sys_QueryInfos", new[] { "ColumnKey" });
  1085. DropIndex("dbo.Sys_QueryInfos", new[] { "TableKey" });
  1086. DropIndex("dbo.Sys_AuditLogs", new[] { "UserId" });
  1087. DropIndex("dbo.Sys_AuditLogs", new[] { "TenantId" });
  1088. DropIndex("dbo.Sys_SysHelps", new[] { "CreatorUserId" });
  1089. DropIndex("dbo.Sys_SysHelps", new[] { "LastModifierUserId" });
  1090. DropIndex("dbo.Sys_SysHelps", new[] { "DeleterUserId" });
  1091. DropIndex("dbo.Sys_SysHelps", new[] { "IsDeleted" });
  1092. DropIndex("dbo.Sys_Functions", new[] { "CreatorUserId" });
  1093. DropIndex("dbo.Sys_Functions", new[] { "LastModifierUserId" });
  1094. DropIndex("dbo.Sys_Functions", new[] { "DeleterUserId" });
  1095. DropIndex("dbo.Sys_Functions", new[] { "IsDeleted" });
  1096. DropIndex("dbo.Sys_Functions", new[] { "PermissionName" });
  1097. DropIndex("dbo.Sys_Functions", new[] { "FunctionNo" });
  1098. DropIndex("dbo.Sys_AttachFiles", new[] { "CreatorUserId" });
  1099. DropIndex("dbo.Sys_AttachFiles", new[] { "TenantId" });
  1100. DropIndex("dbo.Sys_AppGuids", new[] { "IdType" });
  1101. DropIndex("dbo.Cs_StaffRelateInfos", new[] { "CreatorUserId" });
  1102. DropIndex("dbo.Cs_StaffRelateInfos", new[] { "ContractNo" });
  1103. DropIndex("dbo.Cs_StaffRelateInfos", new[] { "CaseNo" });
  1104. DropIndex("dbo.Cs_StaffRelateInfos", new[] { "CompanyNo" });
  1105. DropIndex("dbo.Cs_StaffRelateInfos", new[] { "StaffNo" });
  1106. DropIndex("dbo.Sys_RoleClaims", new[] { "RoleId" });
  1107. DropIndex("dbo.Sys_RoleClaims", new[] { "TenantId" });
  1108. DropIndex("dbo.Sys_Roles", new[] { "CreatorUserId" });
  1109. DropIndex("dbo.Sys_Roles", new[] { "LastModifierUserId" });
  1110. DropIndex("dbo.Sys_Roles", new[] { "DeleterUserId" });
  1111. DropIndex("dbo.Sys_Roles", new[] { "IsDeleted" });
  1112. DropIndex("dbo.Sys_Roles", new[] { "AccountType" });
  1113. DropIndex("dbo.Sys_Roles", new[] { "RoleType" });
  1114. DropIndex("dbo.Sys_Roles", new[] { "Name" });
  1115. DropIndex("dbo.Sys_Roles", new[] { "TenantId" });
  1116. DropIndex("dbo.Sys_NotificationSubscriptions", new[] { "NotificationName", "EntityTypeName", "EntityId", "UserId" });
  1117. DropIndex("dbo.Sys_NotificationSubscriptions", new[] { "TenantId" });
  1118. DropIndex("dbo.Ls_LegalCaseNotes", new[] { "CreatorUserId" });
  1119. DropIndex("dbo.Ls_LegalCaseNotes", new[] { "CaseNo" });
  1120. DropIndex("dbo.Ls_LegalContractSupplements", new[] { "CreatorUserId" });
  1121. DropIndex("dbo.Ls_LegalContractSupplements", new[] { "ContractNo" });
  1122. DropIndex("dbo.Ls_LegalContractNotes", new[] { "CreatorUserId" });
  1123. DropIndex("dbo.Ls_LegalContractNotes", new[] { "KeyPointNo" });
  1124. DropIndex("dbo.Ls_LegalContractNotes", new[] { "ContractNo" });
  1125. DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "CreatorUserId" });
  1126. DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "LastModifierUserId" });
  1127. DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "ContractNo" });
  1128. DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "ParentNo" });
  1129. DropIndex("dbo.Ls_LegalContractContents", new[] { "CreatorUserId" });
  1130. DropIndex("dbo.Ls_LegalContracts", new[] { "CreatorUserId" });
  1131. DropIndex("dbo.Ls_LegalContracts", new[] { "LastModifierUserId" });
  1132. DropIndex("dbo.Ls_LegalContracts", new[] { "DeleterUserId" });
  1133. DropIndex("dbo.Ls_LegalContracts", new[] { "IsDeleted" });
  1134. DropIndex("dbo.Ls_LegalContracts", new[] { "CaseNo" });
  1135. DropIndex("dbo.Ls_LegalCases", new[] { "CreatorUserId" });
  1136. DropIndex("dbo.Ls_LegalCases", new[] { "LastModifierUserId" });
  1137. DropIndex("dbo.Ls_LegalCases", new[] { "DeleterUserId" });
  1138. DropIndex("dbo.Ls_LegalCases", new[] { "IsDeleted" });
  1139. DropIndex("dbo.Ls_LegalCases", new[] { "CompanyNo" });
  1140. DropIndex("dbo.Ls_LegalCases", new[] { "ServiceType" });
  1141. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "CreatorUserId" });
  1142. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "ContractNo" });
  1143. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "CaseNo" });
  1144. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "LawFirmNo" });
  1145. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "MasterType" });
  1146. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "RelatedType" });
  1147. DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "LawyerNo" });
  1148. DropIndex("dbo.Ls_Lawyers", new[] { "CreatorUserId" });
  1149. DropIndex("dbo.Ls_Lawyers", new[] { "LastModifierUserId" });
  1150. DropIndex("dbo.Ls_Lawyers", new[] { "DeleterUserId" });
  1151. DropIndex("dbo.Ls_Lawyers", new[] { "IsDeleted" });
  1152. DropIndex("dbo.Ls_LawFirms", new[] { "CreatorUserId" });
  1153. DropIndex("dbo.Ls_LawFirms", new[] { "LastModifierUserId" });
  1154. DropIndex("dbo.Ls_LawFirms", new[] { "DeleterUserId" });
  1155. DropIndex("dbo.Ls_LawFirms", new[] { "IsDeleted" });
  1156. DropIndex("dbo.Sys_Permissions", new[] { "TenantId" });
  1157. DropIndex("dbo.Cs_ClientStaffs", new[] { "CreatorUserId" });
  1158. DropIndex("dbo.Cs_ClientStaffs", new[] { "LastModifierUserId" });
  1159. DropIndex("dbo.Cs_ClientStaffs", new[] { "DeleterUserId" });
  1160. DropIndex("dbo.Cs_ClientStaffs", new[] { "IsDeleted" });
  1161. DropIndex("dbo.Cs_ClientStaffs", new[] { "OrganizationNo" });
  1162. DropIndex("dbo.Cs_ClientStaffs", new[] { "CompanyNo" });
  1163. DropIndex("dbo.Cs_ClientOrganizations", new[] { "CreatorUserId" });
  1164. DropIndex("dbo.Cs_ClientOrganizations", new[] { "CompanyNo" });
  1165. DropIndex("dbo.Cs_ClientOrganizations", new[] { "ParentNo" });
  1166. DropIndex("dbo.Sys_Settings", new[] { "TenantId", "Name", "UserId" });
  1167. DropIndex("dbo.Sys_UserRoles", new[] { "UserId" });
  1168. DropIndex("dbo.Sys_UserRoles", new[] { "TenantId" });
  1169. DropIndex("dbo.Sys_UserLogins", new[] { "UserId" });
  1170. DropIndex("dbo.Sys_UserLogins", new[] { "TenantId" });
  1171. DropIndex("dbo.Sys_UserClaims", new[] { "UserId" });
  1172. DropIndex("dbo.Sys_UserClaims", new[] { "TenantId" });
  1173. DropIndex("dbo.Sys_Users", new[] { "CreatorUserId" });
  1174. DropIndex("dbo.Sys_Users", new[] { "LastModifierUserId" });
  1175. DropIndex("dbo.Sys_Users", new[] { "DeleterUserId" });
  1176. DropIndex("dbo.Sys_Users", new[] { "IsDeleted" });
  1177. DropIndex("dbo.Sys_Users", new[] { "PhoneNumber" });
  1178. DropIndex("dbo.Sys_Users", new[] { "EmailAddress" });
  1179. DropIndex("dbo.Sys_Users", new[] { "TenantId" });
  1180. DropIndex("dbo.Sys_Users", new[] { "AccountType" });
  1181. DropIndex("dbo.Sys_Users", new[] { "UserType" });
  1182. DropIndex("dbo.Sys_Users", new[] { "UserName" });
  1183. DropIndex("dbo.Cs_ClientCompanies", new[] { "CreatorUserId" });
  1184. DropIndex("dbo.Cs_ClientCompanies", new[] { "LastModifierUserId" });
  1185. DropIndex("dbo.Cs_ClientCompanies", new[] { "DeleterUserId" });
  1186. DropIndex("dbo.Cs_ClientCompanies", new[] { "IsDeleted" });
  1187. DropTable("dbo.Sys_NotificationUsers",
  1188. removedAnnotations: new Dictionary<string, object>
  1189. {
  1190. { "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1191. });
  1192. DropTable("dbo.Sys_UserLoginAttempts",
  1193. removedAnnotations: new Dictionary<string, object>
  1194. {
  1195. { "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1196. });
  1197. DropTable("dbo.Sys_UserAccounts",
  1198. removedAnnotations: new Dictionary<string, object>
  1199. {
  1200. { "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1201. });
  1202. DropTable("dbo.Sys_Tenants",
  1203. removedAnnotations: new Dictionary<string, object>
  1204. {
  1205. { "DynamicFilter_Tenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1206. });
  1207. DropTable("dbo.Sys_NotificationTenants",
  1208. removedAnnotations: new Dictionary<string, object>
  1209. {
  1210. { "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1211. });
  1212. DropTable("dbo.Sys_States",
  1213. removedAnnotations: new Dictionary<string, object>
  1214. {
  1215. { "DynamicFilter_SysState_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1216. });
  1217. DropTable("dbo.Sys_QueryInfos");
  1218. DropTable("dbo.Sys_AuditLogs",
  1219. removedAnnotations: new Dictionary<string, object>
  1220. {
  1221. { "DynamicFilter_SysLog_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1222. });
  1223. DropTable("dbo.Sys_SysHelps",
  1224. removedAnnotations: new Dictionary<string, object>
  1225. {
  1226. { "DynamicFilter_SysHelp_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1227. });
  1228. DropTable("dbo.Sys_Functions",
  1229. removedAnnotations: new Dictionary<string, object>
  1230. {
  1231. { "DynamicFilter_SysFunction_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1232. });
  1233. DropTable("dbo.Sys_AttachFiles",
  1234. removedAnnotations: new Dictionary<string, object>
  1235. {
  1236. { "DynamicFilter_SysAttachFile_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1237. });
  1238. DropTable("dbo.Sys_AppGuids");
  1239. DropTable("dbo.Cs_StaffRelateInfos");
  1240. DropTable("dbo.Sys_RoleClaims",
  1241. removedAnnotations: new Dictionary<string, object>
  1242. {
  1243. { "DynamicFilter_RoleClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1244. });
  1245. DropTable("dbo.Sys_Roles",
  1246. removedAnnotations: new Dictionary<string, object>
  1247. {
  1248. { "DynamicFilter_Role_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1249. { "DynamicFilter_Role_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1250. });
  1251. DropTable("dbo.Sys_NotificationSubscriptions",
  1252. removedAnnotations: new Dictionary<string, object>
  1253. {
  1254. { "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1255. });
  1256. DropTable("dbo.Sys_Notifications");
  1257. DropTable("dbo.Ls_LegalCaseNotes");
  1258. DropTable("dbo.Ls_LegalContractSupplements");
  1259. DropTable("dbo.Ls_LegalContractNotes");
  1260. DropTable("dbo.Ls_LegalContractKeyPoints");
  1261. DropTable("dbo.Ls_LegalContractContents");
  1262. DropTable("dbo.Ls_LegalContracts",
  1263. removedAnnotations: new Dictionary<string, object>
  1264. {
  1265. { "DynamicFilter_LegalContractInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1266. });
  1267. DropTable("dbo.Base_LegalServiceTypes");
  1268. DropTable("dbo.Ls_LegalCases",
  1269. removedAnnotations: new Dictionary<string, object>
  1270. {
  1271. { "DynamicFilter_LegalCaseInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1272. });
  1273. DropTable("dbo.Ls_LawyerRelatedInfos");
  1274. DropTable("dbo.Ls_Lawyers",
  1275. removedAnnotations: new Dictionary<string, object>
  1276. {
  1277. { "DynamicFilter_LawyerInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1278. });
  1279. DropTable("dbo.Ls_LawFirms",
  1280. removedAnnotations: new Dictionary<string, object>
  1281. {
  1282. { "DynamicFilter_LawFirmInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1283. });
  1284. DropTable("dbo.Sys_Permissions",
  1285. removedAnnotations: new Dictionary<string, object>
  1286. {
  1287. { "DynamicFilter_DataPermission_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1288. { "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1289. { "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1290. { "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1291. });
  1292. DropTable("dbo.Cs_ClientStaffs",
  1293. removedAnnotations: new Dictionary<string, object>
  1294. {
  1295. { "DynamicFilter_ClientStaffInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1296. });
  1297. DropTable("dbo.Cs_ClientOrganizations");
  1298. DropTable("dbo.Sys_Settings",
  1299. removedAnnotations: new Dictionary<string, object>
  1300. {
  1301. { "DynamicFilter_SysSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1302. });
  1303. DropTable("dbo.Sys_UserRoles",
  1304. removedAnnotations: new Dictionary<string, object>
  1305. {
  1306. { "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1307. });
  1308. DropTable("dbo.Sys_UserLogins",
  1309. removedAnnotations: new Dictionary<string, object>
  1310. {
  1311. { "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1312. });
  1313. DropTable("dbo.Sys_UserClaims",
  1314. removedAnnotations: new Dictionary<string, object>
  1315. {
  1316. { "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1317. });
  1318. DropTable("dbo.Sys_Users",
  1319. removedAnnotations: new Dictionary<string, object>
  1320. {
  1321. { "DynamicFilter_User_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1322. { "DynamicFilter_User_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1323. });
  1324. DropTable("dbo.Cs_ClientCompanies",
  1325. removedAnnotations: new Dictionary<string, object>
  1326. {
  1327. { "DynamicFilter_ClientCompanyInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
  1328. });
  1329. }
  1330. }
  1331. }