20211129071950_EditStore.cs 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace Ropin.Inspection.Model.Migrations
  4. {
  5. public partial class EditStore : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. //migrationBuilder.DropForeignKey(
  10. // name: "FK_TPNT_TypeTPNT_Store_Code",
  11. // table: "TPNT_Store");
  12. //migrationBuilder.DropForeignKey(
  13. // name: "FK_TSYS_LicenseTPNT_Store_Code",
  14. // table: "TPNT_Store");
  15. migrationBuilder.DropForeignKey(
  16. name: "FK_TBDM_Area_TBDM_City_C_CityCode",
  17. table: "TBDM_Area");
  18. migrationBuilder.DropForeignKey(
  19. name: "FK_TBDM_City_TBDM_Prov_C_ProvCode",
  20. table: "TBDM_City");
  21. migrationBuilder.DropForeignKey(
  22. name: "FK_TBDM_CodeDetail_TSYS_User_C_CreateBy",
  23. table: "TBDM_CodeDetail");
  24. migrationBuilder.DropForeignKey(
  25. name: "FK_TBDM_CodeMain_TSYS_User_C_CreateBy",
  26. table: "TBDM_CodeMain");
  27. migrationBuilder.DropForeignKey(
  28. name: "FK_TDEV_DevAlertConfig_TSYS_User_C_CreateBy",
  29. table: "TDEV_DevAlertConfig");
  30. migrationBuilder.DropForeignKey(
  31. name: "FK_TDEV_DevDataConfig_TSYS_User_C_CreateBy",
  32. table: "TDEV_DevDataConfig");
  33. migrationBuilder.DropForeignKey(
  34. name: "FK_TDEV_Device_TSYS_User_C_CreateBy",
  35. table: "TDEV_Device");
  36. migrationBuilder.DropForeignKey(
  37. name: "FK_TPNT_Area_TPNT_Store_C_StoreCode",
  38. table: "TPNT_Area");
  39. migrationBuilder.DropForeignKey(
  40. name: "FK_TPNT_Area_TSYS_User_C_CreateBy",
  41. table: "TPNT_Area");
  42. migrationBuilder.DropForeignKey(
  43. name: "FK_TPNT_Store_TSYS_User_C_CreateBy",
  44. table: "TPNT_Store");
  45. migrationBuilder.DropForeignKey(
  46. name: "FK_TPNT_StoreOrg_TSYS_User_C_CreateBy",
  47. table: "TPNT_StoreOrg");
  48. migrationBuilder.DropForeignKey(
  49. name: "FK_TPRD_ProdSKU_TSYS_User_C_CreateBy",
  50. table: "TPRD_ProdSKU");
  51. migrationBuilder.DropForeignKey(
  52. name: "FK_TPRD_Product_TSYS_User_C_CreateBy",
  53. table: "TPRD_Product");
  54. migrationBuilder.DropForeignKey(
  55. name: "FK_TPRD_Type_TSYS_User_C_CreateBy",
  56. table: "TPRD_Type");
  57. migrationBuilder.DropForeignKey(
  58. name: "FK_TSYS_License_TSYS_LicenseType_C_TypeCode",
  59. table: "TSYS_License");
  60. migrationBuilder.DropForeignKey(
  61. name: "FK_TSYS_License_TSYS_User_C_CreateBy",
  62. table: "TSYS_License");
  63. migrationBuilder.DropForeignKey(
  64. name: "FK_TSYS_LicenseType_TSYS_User_C_CreateBy",
  65. table: "TSYS_LicenseType");
  66. migrationBuilder.DropForeignKey(
  67. name: "FK_TSYS_LicenseTypePriv_TSYS_LicenseType_C_LicenseTypeCode",
  68. table: "TSYS_LicenseTypePriv");
  69. migrationBuilder.DropForeignKey(
  70. name: "FK_TSYS_LicenseTypePriv_TSYS_Priv_C_PrivilegeCode",
  71. table: "TSYS_LicenseTypePriv");
  72. migrationBuilder.DropForeignKey(
  73. name: "FK_TSYS_LicenseTypePriv_TSYS_User_C_CreateBy",
  74. table: "TSYS_LicenseTypePriv");
  75. migrationBuilder.DropForeignKey(
  76. name: "FK_TSYS_Message_TSYS_User_C_CreateBy",
  77. table: "TSYS_Message");
  78. migrationBuilder.DropForeignKey(
  79. name: "FK_TSYS_Message_TSYS_User_C_UserID",
  80. table: "TSYS_Message");
  81. migrationBuilder.DropForeignKey(
  82. name: "FK_TSYS_Org_TSYS_Org_C_ParentCode",
  83. table: "TSYS_Org");
  84. migrationBuilder.DropForeignKey(
  85. name: "FK_TSYS_Org_TSYS_User_C_CreateBy",
  86. table: "TSYS_Org");
  87. migrationBuilder.DropForeignKey(
  88. name: "FK_TSYS_Role_TSYS_User_C_CreateBy",
  89. table: "TSYS_Role");
  90. migrationBuilder.DropForeignKey(
  91. name: "FK_TSYS_RolePriv_TSYS_Role_C_RoleCode",
  92. table: "TSYS_RolePriv");
  93. migrationBuilder.DropForeignKey(
  94. name: "FK_TSYS_RolePriv_TSYS_User_C_CreateBy",
  95. table: "TSYS_RolePriv");
  96. migrationBuilder.DropForeignKey(
  97. name: "FK_TSYS_User_TSYS_User_C_CreateBy",
  98. table: "TSYS_User");
  99. migrationBuilder.DropForeignKey(
  100. name: "FK_TSYS_UserRole_TSYS_Role_C_RoleCode",
  101. table: "TSYS_UserRole");
  102. migrationBuilder.DropForeignKey(
  103. name: "FK_TSYS_UserRole_TSYS_User_C_CreateBy",
  104. table: "TSYS_UserRole");
  105. migrationBuilder.DropForeignKey(
  106. name: "FK_TSYS_UserRole_TSYS_User_C_UserCode",
  107. table: "TSYS_UserRole");
  108. migrationBuilder.DropForeignKey(
  109. name: "FK_TSYS_Version_TSYS_User_C_CreateBy",
  110. table: "TSYS_Version");
  111. migrationBuilder.AddColumn<Guid>(
  112. name: "LicenseC_ID",
  113. table: "TPNT_Store",
  114. type: "char(36)",
  115. nullable: true);
  116. migrationBuilder.CreateIndex(
  117. name: "IX_TPNT_Store_LicenseC_ID",
  118. table: "TPNT_Store",
  119. column: "LicenseC_ID");
  120. migrationBuilder.AddForeignKey(
  121. name: "FK_TBDM_Area_TBDM_City_C_CityCode",
  122. table: "TBDM_Area",
  123. column: "C_CityCode",
  124. principalTable: "TBDM_City",
  125. principalColumn: "C_Code",
  126. onDelete: ReferentialAction.Restrict);
  127. migrationBuilder.AddForeignKey(
  128. name: "FK_TBDM_City_TBDM_Prov_C_ProvCode",
  129. table: "TBDM_City",
  130. column: "C_ProvCode",
  131. principalTable: "TBDM_Prov",
  132. principalColumn: "C_Code",
  133. onDelete: ReferentialAction.Restrict);
  134. migrationBuilder.AddForeignKey(
  135. name: "FK_TBDM_CodeDetail_TSYS_User_C_CreateBy",
  136. table: "TBDM_CodeDetail",
  137. column: "C_CreateBy",
  138. principalTable: "TSYS_User",
  139. principalColumn: "C_UserID",
  140. onDelete: ReferentialAction.Restrict);
  141. migrationBuilder.AddForeignKey(
  142. name: "FK_TBDM_CodeMain_TSYS_User_C_CreateBy",
  143. table: "TBDM_CodeMain",
  144. column: "C_CreateBy",
  145. principalTable: "TSYS_User",
  146. principalColumn: "C_UserID",
  147. onDelete: ReferentialAction.Restrict);
  148. migrationBuilder.AddForeignKey(
  149. name: "FK_TDEV_DevAlertConfig_TSYS_User_C_CreateBy",
  150. table: "TDEV_DevAlertConfig",
  151. column: "C_CreateBy",
  152. principalTable: "TSYS_User",
  153. principalColumn: "C_UserID",
  154. onDelete: ReferentialAction.Restrict);
  155. migrationBuilder.AddForeignKey(
  156. name: "FK_TDEV_DevDataConfig_TSYS_User_C_CreateBy",
  157. table: "TDEV_DevDataConfig",
  158. column: "C_CreateBy",
  159. principalTable: "TSYS_User",
  160. principalColumn: "C_UserID",
  161. onDelete: ReferentialAction.Restrict);
  162. migrationBuilder.AddForeignKey(
  163. name: "FK_TDEV_Device_TSYS_User_C_CreateBy",
  164. table: "TDEV_Device",
  165. column: "C_CreateBy",
  166. principalTable: "TSYS_User",
  167. principalColumn: "C_UserID",
  168. onDelete: ReferentialAction.Restrict);
  169. migrationBuilder.AddForeignKey(
  170. name: "FK_TPNT_Area_TPNT_Store_C_StoreCode",
  171. table: "TPNT_Area",
  172. column: "C_StoreCode",
  173. principalTable: "TPNT_Store",
  174. principalColumn: "C_ID",
  175. onDelete: ReferentialAction.Restrict);
  176. migrationBuilder.AddForeignKey(
  177. name: "FK_TPNT_Area_TSYS_User_C_CreateBy",
  178. table: "TPNT_Area",
  179. column: "C_CreateBy",
  180. principalTable: "TSYS_User",
  181. principalColumn: "C_UserID",
  182. onDelete: ReferentialAction.Restrict);
  183. migrationBuilder.AddForeignKey(
  184. name: "FK_TPNT_Store_TSYS_License_LicenseC_ID",
  185. table: "TPNT_Store",
  186. column: "LicenseC_ID",
  187. principalTable: "TSYS_License",
  188. principalColumn: "C_ID",
  189. onDelete: ReferentialAction.Restrict);
  190. migrationBuilder.AddForeignKey(
  191. name: "FK_TPNT_Store_TSYS_User_C_CreateBy",
  192. table: "TPNT_Store",
  193. column: "C_CreateBy",
  194. principalTable: "TSYS_User",
  195. principalColumn: "C_UserID",
  196. onDelete: ReferentialAction.Restrict);
  197. migrationBuilder.AddForeignKey(
  198. name: "FK_TPNT_StoreOrg_TSYS_User_C_CreateBy",
  199. table: "TPNT_StoreOrg",
  200. column: "C_CreateBy",
  201. principalTable: "TSYS_User",
  202. principalColumn: "C_UserID",
  203. onDelete: ReferentialAction.Restrict);
  204. migrationBuilder.AddForeignKey(
  205. name: "FK_TPRD_ProdSKU_TSYS_User_C_CreateBy",
  206. table: "TPRD_ProdSKU",
  207. column: "C_CreateBy",
  208. principalTable: "TSYS_User",
  209. principalColumn: "C_UserID",
  210. onDelete: ReferentialAction.Restrict);
  211. migrationBuilder.AddForeignKey(
  212. name: "FK_TPRD_Product_TSYS_User_C_CreateBy",
  213. table: "TPRD_Product",
  214. column: "C_CreateBy",
  215. principalTable: "TSYS_User",
  216. principalColumn: "C_UserID",
  217. onDelete: ReferentialAction.Restrict);
  218. migrationBuilder.AddForeignKey(
  219. name: "FK_TPRD_Type_TSYS_User_C_CreateBy",
  220. table: "TPRD_Type",
  221. column: "C_CreateBy",
  222. principalTable: "TSYS_User",
  223. principalColumn: "C_UserID",
  224. onDelete: ReferentialAction.Restrict);
  225. migrationBuilder.AddForeignKey(
  226. name: "FK_TSYS_License_TSYS_LicenseType_C_TypeCode",
  227. table: "TSYS_License",
  228. column: "C_TypeCode",
  229. principalTable: "TSYS_LicenseType",
  230. principalColumn: "C_Code",
  231. onDelete: ReferentialAction.Restrict);
  232. migrationBuilder.AddForeignKey(
  233. name: "FK_TSYS_License_TSYS_User_C_CreateBy",
  234. table: "TSYS_License",
  235. column: "C_CreateBy",
  236. principalTable: "TSYS_User",
  237. principalColumn: "C_UserID",
  238. onDelete: ReferentialAction.Restrict);
  239. migrationBuilder.AddForeignKey(
  240. name: "FK_TSYS_LicenseType_TSYS_User_C_CreateBy",
  241. table: "TSYS_LicenseType",
  242. column: "C_CreateBy",
  243. principalTable: "TSYS_User",
  244. principalColumn: "C_UserID",
  245. onDelete: ReferentialAction.Restrict);
  246. migrationBuilder.AddForeignKey(
  247. name: "FK_TSYS_LicenseTypePriv_TSYS_LicenseType_C_LicenseTypeCode",
  248. table: "TSYS_LicenseTypePriv",
  249. column: "C_LicenseTypeCode",
  250. principalTable: "TSYS_LicenseType",
  251. principalColumn: "C_Code",
  252. onDelete: ReferentialAction.Restrict);
  253. migrationBuilder.AddForeignKey(
  254. name: "FK_TSYS_LicenseTypePriv_TSYS_Priv_C_PrivilegeCode",
  255. table: "TSYS_LicenseTypePriv",
  256. column: "C_PrivilegeCode",
  257. principalTable: "TSYS_Priv",
  258. principalColumn: "C_Code",
  259. onDelete: ReferentialAction.Restrict);
  260. migrationBuilder.AddForeignKey(
  261. name: "FK_TSYS_LicenseTypePriv_TSYS_User_C_CreateBy",
  262. table: "TSYS_LicenseTypePriv",
  263. column: "C_CreateBy",
  264. principalTable: "TSYS_User",
  265. principalColumn: "C_UserID",
  266. onDelete: ReferentialAction.Restrict);
  267. migrationBuilder.AddForeignKey(
  268. name: "FK_TSYS_Message_TSYS_User_C_CreateBy",
  269. table: "TSYS_Message",
  270. column: "C_CreateBy",
  271. principalTable: "TSYS_User",
  272. principalColumn: "C_UserID",
  273. onDelete: ReferentialAction.Restrict);
  274. migrationBuilder.AddForeignKey(
  275. name: "FK_TSYS_Message_TSYS_User_C_UserID",
  276. table: "TSYS_Message",
  277. column: "C_UserID",
  278. principalTable: "TSYS_User",
  279. principalColumn: "C_UserID",
  280. onDelete: ReferentialAction.Restrict);
  281. migrationBuilder.AddForeignKey(
  282. name: "FK_TSYS_Org_TSYS_Org_C_ParentCode",
  283. table: "TSYS_Org",
  284. column: "C_ParentCode",
  285. principalTable: "TSYS_Org",
  286. principalColumn: "K_ID",
  287. onDelete: ReferentialAction.Restrict);
  288. migrationBuilder.AddForeignKey(
  289. name: "FK_TSYS_Org_TSYS_User_C_CreateBy",
  290. table: "TSYS_Org",
  291. column: "C_CreateBy",
  292. principalTable: "TSYS_User",
  293. principalColumn: "C_UserID",
  294. onDelete: ReferentialAction.Restrict);
  295. migrationBuilder.AddForeignKey(
  296. name: "FK_TSYS_Role_TSYS_User_C_CreateBy",
  297. table: "TSYS_Role",
  298. column: "C_CreateBy",
  299. principalTable: "TSYS_User",
  300. principalColumn: "C_UserID",
  301. onDelete: ReferentialAction.Restrict);
  302. migrationBuilder.AddForeignKey(
  303. name: "FK_TSYS_RolePriv_TSYS_Role_C_RoleCode",
  304. table: "TSYS_RolePriv",
  305. column: "C_RoleCode",
  306. principalTable: "TSYS_Role",
  307. principalColumn: "C_Code",
  308. onDelete: ReferentialAction.Restrict);
  309. migrationBuilder.AddForeignKey(
  310. name: "FK_TSYS_RolePriv_TSYS_User_C_CreateBy",
  311. table: "TSYS_RolePriv",
  312. column: "C_CreateBy",
  313. principalTable: "TSYS_User",
  314. principalColumn: "C_UserID",
  315. onDelete: ReferentialAction.Restrict);
  316. migrationBuilder.AddForeignKey(
  317. name: "FK_TSYS_User_TSYS_User_C_CreateBy",
  318. table: "TSYS_User",
  319. column: "C_CreateBy",
  320. principalTable: "TSYS_User",
  321. principalColumn: "C_UserID",
  322. onDelete: ReferentialAction.Restrict);
  323. migrationBuilder.AddForeignKey(
  324. name: "FK_TSYS_UserRole_TSYS_Role_C_RoleCode",
  325. table: "TSYS_UserRole",
  326. column: "C_RoleCode",
  327. principalTable: "TSYS_Role",
  328. principalColumn: "C_Code",
  329. onDelete: ReferentialAction.Restrict);
  330. migrationBuilder.AddForeignKey(
  331. name: "FK_TSYS_UserRole_TSYS_User_C_CreateBy",
  332. table: "TSYS_UserRole",
  333. column: "C_CreateBy",
  334. principalTable: "TSYS_User",
  335. principalColumn: "C_UserID",
  336. onDelete: ReferentialAction.Restrict);
  337. migrationBuilder.AddForeignKey(
  338. name: "FK_TSYS_UserRole_TSYS_User_C_UserCode",
  339. table: "TSYS_UserRole",
  340. column: "C_UserCode",
  341. principalTable: "TSYS_User",
  342. principalColumn: "C_UserID",
  343. onDelete: ReferentialAction.Restrict);
  344. migrationBuilder.AddForeignKey(
  345. name: "FK_TSYS_Version_TSYS_User_C_CreateBy",
  346. table: "TSYS_Version",
  347. column: "C_CreateBy",
  348. principalTable: "TSYS_User",
  349. principalColumn: "C_UserID",
  350. onDelete: ReferentialAction.Restrict);
  351. }
  352. protected override void Down(MigrationBuilder migrationBuilder)
  353. {
  354. migrationBuilder.DropForeignKey(
  355. name: "FK_TBDM_Area_TBDM_City_C_CityCode",
  356. table: "TBDM_Area");
  357. migrationBuilder.DropForeignKey(
  358. name: "FK_TBDM_City_TBDM_Prov_C_ProvCode",
  359. table: "TBDM_City");
  360. migrationBuilder.DropForeignKey(
  361. name: "FK_TBDM_CodeDetail_TSYS_User_C_CreateBy",
  362. table: "TBDM_CodeDetail");
  363. migrationBuilder.DropForeignKey(
  364. name: "FK_TBDM_CodeMain_TSYS_User_C_CreateBy",
  365. table: "TBDM_CodeMain");
  366. migrationBuilder.DropForeignKey(
  367. name: "FK_TDEV_DevAlertConfig_TSYS_User_C_CreateBy",
  368. table: "TDEV_DevAlertConfig");
  369. migrationBuilder.DropForeignKey(
  370. name: "FK_TDEV_DevDataConfig_TSYS_User_C_CreateBy",
  371. table: "TDEV_DevDataConfig");
  372. migrationBuilder.DropForeignKey(
  373. name: "FK_TDEV_Device_TSYS_User_C_CreateBy",
  374. table: "TDEV_Device");
  375. //migrationBuilder.DropForeignKey(
  376. // name: "FK_TPNT_Area_TPNT_Store_C_StoreCode",
  377. // table: "TPNT_Area");
  378. migrationBuilder.DropForeignKey(
  379. name: "FK_TPNT_Area_TSYS_User_C_CreateBy",
  380. table: "TPNT_Area");
  381. migrationBuilder.DropForeignKey(
  382. name: "FK_TPNT_Store_TSYS_License_LicenseC_ID",
  383. table: "TPNT_Store");
  384. migrationBuilder.DropForeignKey(
  385. name: "FK_TPNT_Store_TSYS_User_C_CreateBy",
  386. table: "TPNT_Store");
  387. migrationBuilder.DropForeignKey(
  388. name: "FK_TPNT_StoreOrg_TSYS_User_C_CreateBy",
  389. table: "TPNT_StoreOrg");
  390. migrationBuilder.DropForeignKey(
  391. name: "FK_TPRD_ProdSKU_TSYS_User_C_CreateBy",
  392. table: "TPRD_ProdSKU");
  393. migrationBuilder.DropForeignKey(
  394. name: "FK_TPRD_Product_TSYS_User_C_CreateBy",
  395. table: "TPRD_Product");
  396. migrationBuilder.DropForeignKey(
  397. name: "FK_TPRD_Type_TSYS_User_C_CreateBy",
  398. table: "TPRD_Type");
  399. migrationBuilder.DropForeignKey(
  400. name: "FK_TSYS_License_TSYS_LicenseType_C_TypeCode",
  401. table: "TSYS_License");
  402. migrationBuilder.DropForeignKey(
  403. name: "FK_TSYS_License_TSYS_User_C_CreateBy",
  404. table: "TSYS_License");
  405. migrationBuilder.DropForeignKey(
  406. name: "FK_TSYS_LicenseType_TSYS_User_C_CreateBy",
  407. table: "TSYS_LicenseType");
  408. migrationBuilder.DropForeignKey(
  409. name: "FK_TSYS_LicenseTypePriv_TSYS_LicenseType_C_LicenseTypeCode",
  410. table: "TSYS_LicenseTypePriv");
  411. migrationBuilder.DropForeignKey(
  412. name: "FK_TSYS_LicenseTypePriv_TSYS_Priv_C_PrivilegeCode",
  413. table: "TSYS_LicenseTypePriv");
  414. migrationBuilder.DropForeignKey(
  415. name: "FK_TSYS_LicenseTypePriv_TSYS_User_C_CreateBy",
  416. table: "TSYS_LicenseTypePriv");
  417. migrationBuilder.DropForeignKey(
  418. name: "FK_TSYS_Message_TSYS_User_C_CreateBy",
  419. table: "TSYS_Message");
  420. migrationBuilder.DropForeignKey(
  421. name: "FK_TSYS_Message_TSYS_User_C_UserID",
  422. table: "TSYS_Message");
  423. migrationBuilder.DropForeignKey(
  424. name: "FK_TSYS_Org_TSYS_Org_C_ParentCode",
  425. table: "TSYS_Org");
  426. migrationBuilder.DropForeignKey(
  427. name: "FK_TSYS_Org_TSYS_User_C_CreateBy",
  428. table: "TSYS_Org");
  429. migrationBuilder.DropForeignKey(
  430. name: "FK_TSYS_Role_TSYS_User_C_CreateBy",
  431. table: "TSYS_Role");
  432. migrationBuilder.DropForeignKey(
  433. name: "FK_TSYS_RolePriv_TSYS_Role_C_RoleCode",
  434. table: "TSYS_RolePriv");
  435. migrationBuilder.DropForeignKey(
  436. name: "FK_TSYS_RolePriv_TSYS_User_C_CreateBy",
  437. table: "TSYS_RolePriv");
  438. migrationBuilder.DropForeignKey(
  439. name: "FK_TSYS_User_TSYS_User_C_CreateBy",
  440. table: "TSYS_User");
  441. migrationBuilder.DropForeignKey(
  442. name: "FK_TSYS_UserRole_TSYS_Role_C_RoleCode",
  443. table: "TSYS_UserRole");
  444. migrationBuilder.DropForeignKey(
  445. name: "FK_TSYS_UserRole_TSYS_User_C_CreateBy",
  446. table: "TSYS_UserRole");
  447. migrationBuilder.DropForeignKey(
  448. name: "FK_TSYS_UserRole_TSYS_User_C_UserCode",
  449. table: "TSYS_UserRole");
  450. migrationBuilder.DropForeignKey(
  451. name: "FK_TSYS_Version_TSYS_User_C_CreateBy",
  452. table: "TSYS_Version");
  453. migrationBuilder.DropIndex(
  454. name: "IX_TPNT_Store_LicenseC_ID",
  455. table: "TPNT_Store");
  456. migrationBuilder.DropColumn(
  457. name: "LicenseC_ID",
  458. table: "TPNT_Store");
  459. migrationBuilder.AddForeignKey(
  460. name: "FK_TBDM_Area_TBDM_City_C_CityCode",
  461. table: "TBDM_Area",
  462. column: "C_CityCode",
  463. principalTable: "TBDM_City",
  464. principalColumn: "C_Code",
  465. onDelete: ReferentialAction.Restrict);
  466. migrationBuilder.AddForeignKey(
  467. name: "FK_TBDM_City_TBDM_Prov_C_ProvCode",
  468. table: "TBDM_City",
  469. column: "C_ProvCode",
  470. principalTable: "TBDM_Prov",
  471. principalColumn: "C_Code",
  472. onDelete: ReferentialAction.Restrict);
  473. migrationBuilder.AddForeignKey(
  474. name: "FK_TBDM_CodeDetail_TSYS_User_C_CreateBy",
  475. table: "TBDM_CodeDetail",
  476. column: "C_CreateBy",
  477. principalTable: "TSYS_User",
  478. principalColumn: "C_UserID",
  479. onDelete: ReferentialAction.Restrict);
  480. migrationBuilder.AddForeignKey(
  481. name: "FK_TBDM_CodeMain_TSYS_User_C_CreateBy",
  482. table: "TBDM_CodeMain",
  483. column: "C_CreateBy",
  484. principalTable: "TSYS_User",
  485. principalColumn: "C_UserID",
  486. onDelete: ReferentialAction.Restrict);
  487. migrationBuilder.AddForeignKey(
  488. name: "FK_TDEV_DevAlertConfig_TSYS_User_C_CreateBy",
  489. table: "TDEV_DevAlertConfig",
  490. column: "C_CreateBy",
  491. principalTable: "TSYS_User",
  492. principalColumn: "C_UserID",
  493. onDelete: ReferentialAction.Restrict);
  494. migrationBuilder.AddForeignKey(
  495. name: "FK_TDEV_DevDataConfig_TSYS_User_C_CreateBy",
  496. table: "TDEV_DevDataConfig",
  497. column: "C_CreateBy",
  498. principalTable: "TSYS_User",
  499. principalColumn: "C_UserID",
  500. onDelete: ReferentialAction.Restrict);
  501. migrationBuilder.AddForeignKey(
  502. name: "FK_TDEV_Device_TSYS_User_C_CreateBy",
  503. table: "TDEV_Device",
  504. column: "C_CreateBy",
  505. principalTable: "TSYS_User",
  506. principalColumn: "C_UserID",
  507. onDelete: ReferentialAction.Restrict);
  508. //migrationBuilder.AddForeignKey(
  509. // name: "FK_TPNT_Area_TPNT_Store_C_StoreCode",
  510. // table: "TPNT_Area",
  511. // column: "C_StoreCode",
  512. // principalTable: "TPNT_Store",
  513. // principalColumn: "C_ID",
  514. // onDelete: ReferentialAction.Restrict);
  515. migrationBuilder.AddForeignKey(
  516. name: "FK_TPNT_Area_TSYS_User_C_CreateBy",
  517. table: "TPNT_Area",
  518. column: "C_CreateBy",
  519. principalTable: "TSYS_User",
  520. principalColumn: "C_UserID",
  521. onDelete: ReferentialAction.Restrict);
  522. migrationBuilder.AddForeignKey(
  523. name: "FK_TPNT_Store_TSYS_User_C_CreateBy",
  524. table: "TPNT_Store",
  525. column: "C_CreateBy",
  526. principalTable: "TSYS_User",
  527. principalColumn: "C_UserID",
  528. onDelete: ReferentialAction.Restrict);
  529. migrationBuilder.AddForeignKey(
  530. name: "FK_TPNT_StoreOrg_TSYS_User_C_CreateBy",
  531. table: "TPNT_StoreOrg",
  532. column: "C_CreateBy",
  533. principalTable: "TSYS_User",
  534. principalColumn: "C_UserID",
  535. onDelete: ReferentialAction.Restrict);
  536. migrationBuilder.AddForeignKey(
  537. name: "FK_TPRD_ProdSKU_TSYS_User_C_CreateBy",
  538. table: "TPRD_ProdSKU",
  539. column: "C_CreateBy",
  540. principalTable: "TSYS_User",
  541. principalColumn: "C_UserID",
  542. onDelete: ReferentialAction.Restrict);
  543. migrationBuilder.AddForeignKey(
  544. name: "FK_TPRD_Product_TSYS_User_C_CreateBy",
  545. table: "TPRD_Product",
  546. column: "C_CreateBy",
  547. principalTable: "TSYS_User",
  548. principalColumn: "C_UserID",
  549. onDelete: ReferentialAction.Restrict);
  550. migrationBuilder.AddForeignKey(
  551. name: "FK_TPRD_Type_TSYS_User_C_CreateBy",
  552. table: "TPRD_Type",
  553. column: "C_CreateBy",
  554. principalTable: "TSYS_User",
  555. principalColumn: "C_UserID",
  556. onDelete: ReferentialAction.Restrict);
  557. migrationBuilder.AddForeignKey(
  558. name: "FK_TSYS_License_TSYS_LicenseType_C_TypeCode",
  559. table: "TSYS_License",
  560. column: "C_TypeCode",
  561. principalTable: "TSYS_LicenseType",
  562. principalColumn: "C_Code",
  563. onDelete: ReferentialAction.Restrict);
  564. migrationBuilder.AddForeignKey(
  565. name: "FK_TSYS_License_TSYS_User_C_CreateBy",
  566. table: "TSYS_License",
  567. column: "C_CreateBy",
  568. principalTable: "TSYS_User",
  569. principalColumn: "C_UserID",
  570. onDelete: ReferentialAction.Restrict);
  571. migrationBuilder.AddForeignKey(
  572. name: "FK_TSYS_LicenseType_TSYS_User_C_CreateBy",
  573. table: "TSYS_LicenseType",
  574. column: "C_CreateBy",
  575. principalTable: "TSYS_User",
  576. principalColumn: "C_UserID",
  577. onDelete: ReferentialAction.Restrict);
  578. migrationBuilder.AddForeignKey(
  579. name: "FK_TSYS_LicenseTypePriv_TSYS_LicenseType_C_LicenseTypeCode",
  580. table: "TSYS_LicenseTypePriv",
  581. column: "C_LicenseTypeCode",
  582. principalTable: "TSYS_LicenseType",
  583. principalColumn: "C_Code",
  584. onDelete: ReferentialAction.Restrict);
  585. migrationBuilder.AddForeignKey(
  586. name: "FK_TSYS_LicenseTypePriv_TSYS_Priv_C_PrivilegeCode",
  587. table: "TSYS_LicenseTypePriv",
  588. column: "C_PrivilegeCode",
  589. principalTable: "TSYS_Priv",
  590. principalColumn: "C_Code",
  591. onDelete: ReferentialAction.Restrict);
  592. migrationBuilder.AddForeignKey(
  593. name: "FK_TSYS_LicenseTypePriv_TSYS_User_C_CreateBy",
  594. table: "TSYS_LicenseTypePriv",
  595. column: "C_CreateBy",
  596. principalTable: "TSYS_User",
  597. principalColumn: "C_UserID",
  598. onDelete: ReferentialAction.Restrict);
  599. migrationBuilder.AddForeignKey(
  600. name: "FK_TSYS_Message_TSYS_User_C_CreateBy",
  601. table: "TSYS_Message",
  602. column: "C_CreateBy",
  603. principalTable: "TSYS_User",
  604. principalColumn: "C_UserID",
  605. onDelete: ReferentialAction.Restrict);
  606. migrationBuilder.AddForeignKey(
  607. name: "FK_TSYS_Message_TSYS_User_C_UserID",
  608. table: "TSYS_Message",
  609. column: "C_UserID",
  610. principalTable: "TSYS_User",
  611. principalColumn: "C_UserID",
  612. onDelete: ReferentialAction.Restrict);
  613. migrationBuilder.AddForeignKey(
  614. name: "FK_TSYS_Org_TSYS_Org_C_ParentCode",
  615. table: "TSYS_Org",
  616. column: "C_ParentCode",
  617. principalTable: "TSYS_Org",
  618. principalColumn: "K_ID",
  619. onDelete: ReferentialAction.Restrict);
  620. migrationBuilder.AddForeignKey(
  621. name: "FK_TSYS_Org_TSYS_User_C_CreateBy",
  622. table: "TSYS_Org",
  623. column: "C_CreateBy",
  624. principalTable: "TSYS_User",
  625. principalColumn: "C_UserID",
  626. onDelete: ReferentialAction.Restrict);
  627. migrationBuilder.AddForeignKey(
  628. name: "FK_TSYS_Role_TSYS_User_C_CreateBy",
  629. table: "TSYS_Role",
  630. column: "C_CreateBy",
  631. principalTable: "TSYS_User",
  632. principalColumn: "C_UserID",
  633. onDelete: ReferentialAction.Restrict);
  634. migrationBuilder.AddForeignKey(
  635. name: "FK_TSYS_RolePriv_TSYS_Role_C_RoleCode",
  636. table: "TSYS_RolePriv",
  637. column: "C_RoleCode",
  638. principalTable: "TSYS_Role",
  639. principalColumn: "C_Code",
  640. onDelete: ReferentialAction.Restrict);
  641. migrationBuilder.AddForeignKey(
  642. name: "FK_TSYS_RolePriv_TSYS_User_C_CreateBy",
  643. table: "TSYS_RolePriv",
  644. column: "C_CreateBy",
  645. principalTable: "TSYS_User",
  646. principalColumn: "C_UserID",
  647. onDelete: ReferentialAction.Restrict);
  648. migrationBuilder.AddForeignKey(
  649. name: "FK_TSYS_User_TSYS_User_C_CreateBy",
  650. table: "TSYS_User",
  651. column: "C_CreateBy",
  652. principalTable: "TSYS_User",
  653. principalColumn: "C_UserID",
  654. onDelete: ReferentialAction.Restrict);
  655. migrationBuilder.AddForeignKey(
  656. name: "FK_TSYS_UserRole_TSYS_Role_C_RoleCode",
  657. table: "TSYS_UserRole",
  658. column: "C_RoleCode",
  659. principalTable: "TSYS_Role",
  660. principalColumn: "C_Code",
  661. onDelete: ReferentialAction.Restrict);
  662. migrationBuilder.AddForeignKey(
  663. name: "FK_TSYS_UserRole_TSYS_User_C_CreateBy",
  664. table: "TSYS_UserRole",
  665. column: "C_CreateBy",
  666. principalTable: "TSYS_User",
  667. principalColumn: "C_UserID",
  668. onDelete: ReferentialAction.Restrict);
  669. migrationBuilder.AddForeignKey(
  670. name: "FK_TSYS_UserRole_TSYS_User_C_UserCode",
  671. table: "TSYS_UserRole",
  672. column: "C_UserCode",
  673. principalTable: "TSYS_User",
  674. principalColumn: "C_UserID",
  675. onDelete: ReferentialAction.Restrict);
  676. migrationBuilder.AddForeignKey(
  677. name: "FK_TSYS_Version_TSYS_User_C_CreateBy",
  678. table: "TSYS_Version",
  679. column: "C_CreateBy",
  680. principalTable: "TSYS_User",
  681. principalColumn: "C_UserID",
  682. onDelete: ReferentialAction.Restrict);
  683. migrationBuilder.AddForeignKey(
  684. name: "FK_TSYS_LicenseTPNT_Store_Code",
  685. table: "TPNT_Store",
  686. column: "C_LicenseCode",
  687. principalTable: "TSYS_License",
  688. principalColumn: "C_Code",
  689. onDelete: ReferentialAction.Restrict);
  690. migrationBuilder.AddForeignKey(
  691. name: "FK_TPNT_StoreOrgTPNT_Store_Code",
  692. table: "TPNT_StoreOrg",
  693. column: "C_StoreCode",
  694. principalTable: "TPNT_Store",
  695. principalColumn: "C_Code",
  696. onDelete: ReferentialAction.Restrict);
  697. migrationBuilder.AddForeignKey(
  698. name: "FK_TPNT_StoreOrgTSYS_OrgC_OrgCode",
  699. table: "TPNT_StoreOrg",
  700. column: "C_OrgCode",
  701. principalTable: "TSYS_Org",
  702. principalColumn: "C_Code",
  703. onDelete: ReferentialAction.Restrict);
  704. //migrationBuilder.AddForeignKey(
  705. // name: "FK_TPNT_TypeTPNT_Store_Code",
  706. // table: "TPNT_Store",
  707. // column: "C_TypeCode",
  708. // principalTable: "TPNT_Type",
  709. // principalColumn: "C_Code",
  710. // onDelete: ReferentialAction.Restrict);
  711. }
  712. }
  713. }