20211130071124_Init03.cs 123 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Metadata;
  3. using Microsoft.EntityFrameworkCore.Migrations;
  4. namespace Ropin.Inspection.Model.Migrations
  5. {
  6. public partial class Init03 : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "Report",
  12. columns: table => new
  13. {
  14. G_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  15. C_StoreCode = table.Column<Guid>(type: "char(36)", nullable: false),
  16. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  17. I_Type = table.Column<int>(type: "int", nullable: false),
  18. C_GroupName = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  19. D_CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  20. D_Start = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  21. D_End = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  22. C_Data = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  23. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  24. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  25. },
  26. constraints: table =>
  27. {
  28. table.PrimaryKey("PK_Report", x => x.G_ID);
  29. });
  30. migrationBuilder.CreateTable(
  31. name: "TasksQz",
  32. columns: table => new
  33. {
  34. Id = table.Column<Guid>(type: "char(36)", nullable: false),
  35. C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  36. Name = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
  37. JobGroup = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
  38. Cron = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
  39. AssemblyName = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
  40. ClassName = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
  41. Remark = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true),
  42. RunTimes = table.Column<int>(type: "int", nullable: false),
  43. BeginTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  44. EndTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  45. TriggerType = table.Column<int>(type: "int", nullable: false),
  46. IntervalSecond = table.Column<int>(type: "int", nullable: false),
  47. CycleRunTimes = table.Column<int>(type: "int", nullable: false),
  48. IsStart = table.Column<bool>(type: "tinyint(1)", nullable: false),
  49. JobParams = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  50. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: true),
  51. CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  52. CreateBy = table.Column<Guid>(type: "char(36)", nullable: false)
  53. },
  54. constraints: table =>
  55. {
  56. table.PrimaryKey("PK_TasksQz", x => x.Id);
  57. });
  58. migrationBuilder.CreateTable(
  59. name: "TBDM_Prov",
  60. columns: table => new
  61. {
  62. C_Code = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
  63. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  64. I_Sort = table.Column<int>(type: "int", nullable: true),
  65. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  66. },
  67. constraints: table =>
  68. {
  69. table.PrimaryKey("PK_TBDM_Prov", x => x.C_Code);
  70. });
  71. migrationBuilder.CreateTable(
  72. name: "TDEV_DevAlert",
  73. columns: table => new
  74. {
  75. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  76. C_DeviceCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  77. C_ConfigCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  78. C_Value = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  79. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  80. },
  81. constraints: table =>
  82. {
  83. table.PrimaryKey("PK_TDEV_DevAlert", x => x.C_ID);
  84. });
  85. migrationBuilder.CreateTable(
  86. name: "TDEV_DevData",
  87. columns: table => new
  88. {
  89. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  90. C_DeviceCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  91. C_ConfigCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  92. C_Value = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  93. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  94. },
  95. constraints: table =>
  96. {
  97. table.PrimaryKey("PK_TDEV_DevData", x => x.C_ID);
  98. });
  99. migrationBuilder.CreateTable(
  100. name: "TISP_RecordAlarm",
  101. columns: table => new
  102. {
  103. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  104. C_InspectionRecordCode = table.Column<Guid>(type: "char(36)", nullable: false),
  105. C_SpotContentCode = table.Column<Guid>(type: "char(36)", nullable: false),
  106. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  107. },
  108. constraints: table =>
  109. {
  110. table.PrimaryKey("PK_TISP_RecordAlarm", x => x.C_ID);
  111. });
  112. migrationBuilder.CreateTable(
  113. name: "TPNT_Type",
  114. columns: table => new
  115. {
  116. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  117. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  118. I_Sort = table.Column<int>(type: "int", nullable: true),
  119. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  120. },
  121. constraints: table =>
  122. {
  123. table.PrimaryKey("PK_TPNT_Type", x => x.C_Code);
  124. });
  125. migrationBuilder.CreateTable(
  126. name: "TSEC_RecordImage",
  127. columns: table => new
  128. {
  129. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  130. C_SecurityRecordCode = table.Column<Guid>(type: "char(36)", nullable: false),
  131. C_ImageURL = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  132. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  133. },
  134. constraints: table =>
  135. {
  136. table.PrimaryKey("PK_TSEC_RecordImage", x => x.C_ID);
  137. });
  138. //migrationBuilder.CreateTable(
  139. // name: "TSYS_Organize",
  140. // columns: table => new
  141. // {
  142. // G_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  143. // G_ParentCode = table.Column<Guid>(type: "char(36)", nullable: false),
  144. // C_Number = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  145. // C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  146. // C_ParentName = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  147. // C_ParentCodeList = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  148. // I_Layer = table.Column<int>(type: "int", nullable: false),
  149. // I_Sort = table.Column<int>(type: "int", nullable: false),
  150. // C_Address = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  151. // C_GPS = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  152. // C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  153. // C_ImageUrl = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  154. // G_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  155. // D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  156. // G_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  157. // D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  158. // C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  159. // },
  160. // constraints: table =>
  161. // {
  162. // table.PrimaryKey("PK_TSYS_Organize", x => x.G_ID);
  163. // });
  164. migrationBuilder.CreateTable(
  165. name: "TSYS_Post",
  166. columns: table => new
  167. {
  168. G_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  169. C_Code = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
  170. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  171. I_Sort = table.Column<int>(type: "int", nullable: false),
  172. C_Remark = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  173. G_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  174. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  175. G_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  176. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  177. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  178. },
  179. constraints: table =>
  180. {
  181. table.PrimaryKey("PK_TSYS_Post", x => x.G_ID);
  182. });
  183. migrationBuilder.CreateTable(
  184. name: "TSYS_Priv",
  185. columns: table => new
  186. {
  187. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  188. C_ParentCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  189. C_Module = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  190. C_Type = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  191. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  192. I_Sort = table.Column<int>(type: "int", nullable: true),
  193. C_ImageUrl = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  194. C_PageUrl = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  195. C_Remark = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  196. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  197. },
  198. constraints: table =>
  199. {
  200. table.PrimaryKey("PK_TSYS_Priv", x => x.C_Code);
  201. table.ForeignKey(
  202. name: "FK_TSYS_Priv_TSYS_Priv_C_ParentCode",
  203. column: x => x.C_ParentCode,
  204. principalTable: "TSYS_Priv",
  205. principalColumn: "C_Code",
  206. onDelete: ReferentialAction.Restrict);
  207. });
  208. migrationBuilder.CreateTable(
  209. name: "TSYS_User",
  210. columns: table => new
  211. {
  212. C_UserID = table.Column<Guid>(type: "char(36)", nullable: false),
  213. C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  214. C_Post = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  215. C_UserName = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  216. C_WechatID = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  217. C_ProgramID = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  218. C_Password = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  219. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  220. I_Render = table.Column<int>(type: "int", nullable: false),
  221. C_IDNum = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  222. C_OrgCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  223. C_ImagePath = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  224. D_BirthDay = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  225. C_Address = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
  226. I_Sort = table.Column<int>(type: "int", nullable: false),
  227. C_Mobile = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true),
  228. C_Phone = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true),
  229. C_Email = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  230. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  231. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  232. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  233. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  234. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  235. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  236. },
  237. constraints: table =>
  238. {
  239. table.PrimaryKey("PK_TSYS_User", x => x.C_UserID);
  240. table.ForeignKey(
  241. name: "FK_TSYS_User_TSYS_User_C_CreateBy",
  242. column: x => x.C_CreateBy,
  243. principalTable: "TSYS_User",
  244. principalColumn: "C_UserID",
  245. onDelete: ReferentialAction.Restrict);
  246. table.ForeignKey(
  247. name: "FK_TSYS_User_TSYS_User_C_LastUpdatedBy",
  248. column: x => x.C_LastUpdatedBy,
  249. principalTable: "TSYS_User",
  250. principalColumn: "C_UserID",
  251. onDelete: ReferentialAction.Restrict);
  252. });
  253. migrationBuilder.CreateTable(
  254. name: "TSYS_UserPost",
  255. columns: table => new
  256. {
  257. G_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  258. G_UserCode = table.Column<Guid>(type: "char(36)", nullable: false),
  259. G_PostCode = table.Column<Guid>(type: "char(36)", nullable: false),
  260. G_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  261. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  262. },
  263. constraints: table =>
  264. {
  265. table.PrimaryKey("PK_TSYS_UserPost", x => x.G_ID);
  266. });
  267. migrationBuilder.CreateTable(
  268. name: "TaskInfoDto",
  269. columns: table => new
  270. {
  271. jobId = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", nullable: false),
  272. jobName = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  273. jobGroup = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  274. triggerId = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  275. triggerName = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  276. triggerGroup = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  277. triggerStatus = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  278. TasksQzId = table.Column<Guid>(type: "char(36)", nullable: true)
  279. },
  280. constraints: table =>
  281. {
  282. table.PrimaryKey("PK_TaskInfoDto", x => x.jobId);
  283. table.ForeignKey(
  284. name: "FK_TaskInfoDto_TasksQz_TasksQzId",
  285. column: x => x.TasksQzId,
  286. principalTable: "TasksQz",
  287. principalColumn: "Id",
  288. onDelete: ReferentialAction.Restrict);
  289. });
  290. migrationBuilder.CreateTable(
  291. name: "TBDM_City",
  292. columns: table => new
  293. {
  294. C_Code = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
  295. C_ProvCode = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
  296. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  297. I_Sort = table.Column<int>(type: "int", nullable: true),
  298. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  299. },
  300. constraints: table =>
  301. {
  302. table.PrimaryKey("PK_TBDM_City", x => x.C_Code);
  303. table.ForeignKey(
  304. name: "FK_TBDM_City_TBDM_Prov_C_ProvCode",
  305. column: x => x.C_ProvCode,
  306. principalTable: "TBDM_Prov",
  307. principalColumn: "C_Code",
  308. onDelete: ReferentialAction.Restrict);
  309. });
  310. migrationBuilder.CreateTable(
  311. name: "TBDM_CodeDetail",
  312. columns: table => new
  313. {
  314. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  315. C_MainCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  316. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  317. C_Value = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
  318. C_IsSys = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false),
  319. C_Default = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false),
  320. I_Sort = table.Column<int>(type: "int", nullable: true),
  321. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  322. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  323. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  324. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  325. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  326. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  327. },
  328. constraints: table =>
  329. {
  330. table.PrimaryKey("PK_TBDM_CodeDetail", x => x.C_Code);
  331. table.ForeignKey(
  332. name: "FK_TBDM_CodeDetail_TSYS_User_C_CreateBy",
  333. column: x => x.C_CreateBy,
  334. principalTable: "TSYS_User",
  335. principalColumn: "C_UserID",
  336. onDelete: ReferentialAction.Restrict);
  337. table.ForeignKey(
  338. name: "FK_TBDM_CodeDetail_TSYS_User_C_LastUpdatedBy",
  339. column: x => x.C_LastUpdatedBy,
  340. principalTable: "TSYS_User",
  341. principalColumn: "C_UserID",
  342. onDelete: ReferentialAction.Restrict);
  343. });
  344. migrationBuilder.CreateTable(
  345. name: "TBDM_CodeMain",
  346. columns: table => new
  347. {
  348. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  349. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  350. I_Sort = table.Column<int>(type: "int", nullable: true),
  351. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  352. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  353. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  354. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  355. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  356. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  357. },
  358. constraints: table =>
  359. {
  360. table.PrimaryKey("PK_TBDM_CodeMain", x => x.C_Code);
  361. table.ForeignKey(
  362. name: "FK_TBDM_CodeMain_TSYS_User_C_CreateBy",
  363. column: x => x.C_CreateBy,
  364. principalTable: "TSYS_User",
  365. principalColumn: "C_UserID",
  366. onDelete: ReferentialAction.Restrict);
  367. table.ForeignKey(
  368. name: "FK_TBDM_CodeMain_TSYS_User_C_LastUpdatedBy",
  369. column: x => x.C_LastUpdatedBy,
  370. principalTable: "TSYS_User",
  371. principalColumn: "C_UserID",
  372. onDelete: ReferentialAction.Restrict);
  373. });
  374. migrationBuilder.CreateTable(
  375. name: "TDEV_DevAlertConfig",
  376. columns: table => new
  377. {
  378. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  379. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  380. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  381. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  382. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  383. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  384. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  385. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  386. },
  387. constraints: table =>
  388. {
  389. table.PrimaryKey("PK_TDEV_DevAlertConfig", x => x.C_Code);
  390. table.ForeignKey(
  391. name: "FK_TDEV_DevAlertConfig_TSYS_User_C_CreateBy",
  392. column: x => x.C_CreateBy,
  393. principalTable: "TSYS_User",
  394. principalColumn: "C_UserID",
  395. onDelete: ReferentialAction.Restrict);
  396. table.ForeignKey(
  397. name: "FK_TDEV_DevAlertConfig_TSYS_User_C_LastUpdatedBy",
  398. column: x => x.C_LastUpdatedBy,
  399. principalTable: "TSYS_User",
  400. principalColumn: "C_UserID",
  401. onDelete: ReferentialAction.Restrict);
  402. });
  403. migrationBuilder.CreateTable(
  404. name: "TDEV_DevDataConfig",
  405. columns: table => new
  406. {
  407. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  408. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  409. I_Interval = table.Column<int>(type: "int", nullable: false),
  410. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  411. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  412. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  413. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  414. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  415. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  416. },
  417. constraints: table =>
  418. {
  419. table.PrimaryKey("PK_TDEV_DevDataConfig", x => x.C_Code);
  420. table.ForeignKey(
  421. name: "FK_TDEV_DevDataConfig_TSYS_User_C_CreateBy",
  422. column: x => x.C_CreateBy,
  423. principalTable: "TSYS_User",
  424. principalColumn: "C_UserID",
  425. onDelete: ReferentialAction.Restrict);
  426. table.ForeignKey(
  427. name: "FK_TDEV_DevDataConfig_TSYS_User_C_LastUpdatedBy",
  428. column: x => x.C_LastUpdatedBy,
  429. principalTable: "TSYS_User",
  430. principalColumn: "C_UserID",
  431. onDelete: ReferentialAction.Restrict);
  432. });
  433. migrationBuilder.CreateTable(
  434. name: "TISP_Content",
  435. columns: table => new
  436. {
  437. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  438. C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  439. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  440. C_AlarmLevel = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false),
  441. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  442. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  443. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  444. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  445. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  446. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  447. },
  448. constraints: table =>
  449. {
  450. table.PrimaryKey("PK_TISP_Content", x => x.C_ID);
  451. table.ForeignKey(
  452. name: "FK_TISP_Content_TSYS_User_C_CreateBy",
  453. column: x => x.C_CreateBy,
  454. principalTable: "TSYS_User",
  455. principalColumn: "C_UserID",
  456. onDelete: ReferentialAction.Restrict);
  457. table.ForeignKey(
  458. name: "FK_TISP_Content_TSYS_User_C_LastUpdatedBy",
  459. column: x => x.C_LastUpdatedBy,
  460. principalTable: "TSYS_User",
  461. principalColumn: "C_UserID",
  462. onDelete: ReferentialAction.Restrict);
  463. });
  464. migrationBuilder.CreateTable(
  465. name: "TISP_ContentGroup",
  466. columns: table => new
  467. {
  468. G_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  469. C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  470. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  471. I_Sort = table.Column<int>(type: "int", nullable: false),
  472. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  473. G_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  474. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  475. G_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  476. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  477. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false),
  478. I_Type = table.Column<int>(type: "int", nullable: false),
  479. C_PatrolItem = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true)
  480. },
  481. constraints: table =>
  482. {
  483. table.PrimaryKey("PK_TISP_ContentGroup", x => x.G_ID);
  484. table.ForeignKey(
  485. name: "FK_TISP_ContentGroup_TSYS_User_G_CreateBy",
  486. column: x => x.G_CreateBy,
  487. principalTable: "TSYS_User",
  488. principalColumn: "C_UserID",
  489. onDelete: ReferentialAction.Restrict);
  490. table.ForeignKey(
  491. name: "FK_TISP_ContentGroup_TSYS_User_G_LastUpdatedBy",
  492. column: x => x.G_LastUpdatedBy,
  493. principalTable: "TSYS_User",
  494. principalColumn: "C_UserID",
  495. onDelete: ReferentialAction.Restrict);
  496. });
  497. migrationBuilder.CreateTable(
  498. name: "TISP_Region",
  499. columns: table => new
  500. {
  501. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  502. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  503. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  504. C_ImageUrl = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  505. C_CreateBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  506. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  507. C_LastUpdatedBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  508. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  509. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  510. },
  511. constraints: table =>
  512. {
  513. table.PrimaryKey("PK_TISP_Region", x => x.C_ID);
  514. table.ForeignKey(
  515. name: "FK_TISP_Region_TSYS_User_C_CreateBy",
  516. column: x => x.C_CreateBy,
  517. principalTable: "TSYS_User",
  518. principalColumn: "C_UserID",
  519. onDelete: ReferentialAction.Restrict);
  520. table.ForeignKey(
  521. name: "FK_TISP_Region_TSYS_User_C_LastUpdatedBy",
  522. column: x => x.C_LastUpdatedBy,
  523. principalTable: "TSYS_User",
  524. principalColumn: "C_UserID",
  525. onDelete: ReferentialAction.Restrict);
  526. });
  527. migrationBuilder.CreateTable(
  528. name: "TISP_Route",
  529. columns: table => new
  530. {
  531. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  532. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  533. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  534. C_ImageUrl = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  535. C_CreateBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  536. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  537. C_LastUpdatedBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  538. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  539. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  540. },
  541. constraints: table =>
  542. {
  543. table.PrimaryKey("PK_TISP_Route", x => x.C_ID);
  544. table.ForeignKey(
  545. name: "FK_TISP_Route_TSYS_User_C_CreateBy",
  546. column: x => x.C_CreateBy,
  547. principalTable: "TSYS_User",
  548. principalColumn: "C_UserID",
  549. onDelete: ReferentialAction.Restrict);
  550. table.ForeignKey(
  551. name: "FK_TISP_Route_TSYS_User_C_LastUpdatedBy",
  552. column: x => x.C_LastUpdatedBy,
  553. principalTable: "TSYS_User",
  554. principalColumn: "C_UserID",
  555. onDelete: ReferentialAction.Restrict);
  556. });
  557. migrationBuilder.CreateTable(
  558. name: "TISP_Spot",
  559. columns: table => new
  560. {
  561. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  562. C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  563. C_Number = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  564. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  565. C_Position = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  566. C_QRCode = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  567. C_AreaCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  568. F_Map_X = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
  569. F_Map_Y = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
  570. C_GPS = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  571. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  572. C_ImageUrl = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  573. I_Offset = table.Column<int>(type: "int", nullable: false),
  574. C_CreateBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  575. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  576. C_LastUpdatedBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  577. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  578. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  579. },
  580. constraints: table =>
  581. {
  582. table.PrimaryKey("PK_TISP_Spot", x => x.C_Code);
  583. table.ForeignKey(
  584. name: "FK_TISP_Spot_TSYS_User_C_CreateBy",
  585. column: x => x.C_CreateBy,
  586. principalTable: "TSYS_User",
  587. principalColumn: "C_UserID",
  588. onDelete: ReferentialAction.Restrict);
  589. table.ForeignKey(
  590. name: "FK_TISP_Spot_TSYS_User_C_LastUpdatedBy",
  591. column: x => x.C_LastUpdatedBy,
  592. principalTable: "TSYS_User",
  593. principalColumn: "C_UserID",
  594. onDelete: ReferentialAction.Restrict);
  595. });
  596. migrationBuilder.CreateTable(
  597. name: "TPNT_StoreOrg",
  598. columns: table => new
  599. {
  600. C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  601. C_OrgCode = table.Column<Guid>(type: "char(36)", nullable: false),
  602. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  603. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  604. },
  605. constraints: table =>
  606. {
  607. table.PrimaryKey("PK_TPNT_StoreOrg", x => new { x.C_StoreCode, x.C_OrgCode });
  608. table.ForeignKey(
  609. name: "FK_TPNT_StoreOrg_TSYS_User_C_CreateBy",
  610. column: x => x.C_CreateBy,
  611. principalTable: "TSYS_User",
  612. principalColumn: "C_UserID",
  613. onDelete: ReferentialAction.Restrict);
  614. });
  615. migrationBuilder.CreateTable(
  616. name: "TPRD_Type",
  617. columns: table => new
  618. {
  619. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  620. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  621. I_IfFPP = table.Column<int>(type: "int", nullable: false),
  622. I_Sort = table.Column<int>(type: "int", nullable: false),
  623. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  624. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  625. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  626. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  627. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  628. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  629. },
  630. constraints: table =>
  631. {
  632. table.PrimaryKey("PK_TPRD_Type", x => x.C_Code);
  633. table.ForeignKey(
  634. name: "FK_TPRD_Type_TSYS_User_C_CreateBy",
  635. column: x => x.C_CreateBy,
  636. principalTable: "TSYS_User",
  637. principalColumn: "C_UserID",
  638. onDelete: ReferentialAction.Restrict);
  639. table.ForeignKey(
  640. name: "FK_TPRD_Type_TSYS_User_C_LastUpdatedBy",
  641. column: x => x.C_LastUpdatedBy,
  642. principalTable: "TSYS_User",
  643. principalColumn: "C_UserID",
  644. onDelete: ReferentialAction.Restrict);
  645. });
  646. migrationBuilder.CreateTable(
  647. name: "TSEC_Record",
  648. columns: table => new
  649. {
  650. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  651. C_SpotCode = table.Column<Guid>(type: "char(36)", nullable: false),
  652. C_SecurityContent = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  653. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  654. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  655. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  656. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  657. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  658. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  659. },
  660. constraints: table =>
  661. {
  662. table.PrimaryKey("PK_TSEC_Record", x => x.C_ID);
  663. table.ForeignKey(
  664. name: "FK_TSEC_Record_TSYS_User_C_CreateBy",
  665. column: x => x.C_CreateBy,
  666. principalTable: "TSYS_User",
  667. principalColumn: "C_UserID",
  668. onDelete: ReferentialAction.Restrict);
  669. table.ForeignKey(
  670. name: "FK_TSEC_Record_TSYS_User_C_LastUpdatedBy",
  671. column: x => x.C_LastUpdatedBy,
  672. principalTable: "TSYS_User",
  673. principalColumn: "C_UserID",
  674. onDelete: ReferentialAction.Restrict);
  675. });
  676. migrationBuilder.CreateTable(
  677. name: "TSEC_RecordItem",
  678. columns: table => new
  679. {
  680. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  681. C_RecordItemCode = table.Column<Guid>(type: "char(36)", nullable: false),
  682. C_SecurityContent = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  683. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  684. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false),
  685. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  686. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  687. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  688. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  689. },
  690. constraints: table =>
  691. {
  692. table.PrimaryKey("PK_TSEC_RecordItem", x => x.C_ID);
  693. table.ForeignKey(
  694. name: "FK_TSEC_RecordItem_TSYS_User_C_CreateBy",
  695. column: x => x.C_CreateBy,
  696. principalTable: "TSYS_User",
  697. principalColumn: "C_UserID",
  698. onDelete: ReferentialAction.Restrict);
  699. table.ForeignKey(
  700. name: "FK_TSEC_RecordItem_TSYS_User_C_LastUpdatedBy",
  701. column: x => x.C_LastUpdatedBy,
  702. principalTable: "TSYS_User",
  703. principalColumn: "C_UserID",
  704. onDelete: ReferentialAction.Restrict);
  705. });
  706. migrationBuilder.CreateTable(
  707. name: "TSYS_LicenseType",
  708. columns: table => new
  709. {
  710. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  711. C_Name = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  712. I_MaxMemberQty = table.Column<int>(type: "int", nullable: false),
  713. I_MaxSpotQty = table.Column<int>(type: "int", nullable: false),
  714. I_MaxFileSize = table.Column<int>(type: "int", nullable: false),
  715. I_Sort = table.Column<int>(type: "int", nullable: false),
  716. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  717. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  718. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  719. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  720. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  721. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  722. },
  723. constraints: table =>
  724. {
  725. table.PrimaryKey("PK_TSYS_LicenseType", x => x.C_Code);
  726. table.ForeignKey(
  727. name: "FK_TSYS_LicenseType_TSYS_User_C_CreateBy",
  728. column: x => x.C_CreateBy,
  729. principalTable: "TSYS_User",
  730. principalColumn: "C_UserID",
  731. onDelete: ReferentialAction.Restrict);
  732. table.ForeignKey(
  733. name: "FK_TSYS_LicenseType_TSYS_User_C_LastUpdatedBy",
  734. column: x => x.C_LastUpdatedBy,
  735. principalTable: "TSYS_User",
  736. principalColumn: "C_UserID",
  737. onDelete: ReferentialAction.Restrict);
  738. });
  739. migrationBuilder.CreateTable(
  740. name: "TSYS_Message",
  741. columns: table => new
  742. {
  743. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  744. C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  745. C_Type = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  746. C_Content = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: false),
  747. C_UserID = table.Column<Guid>(type: "char(36)", nullable: false),
  748. C_RelatedModule = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
  749. C_RelatedID = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  750. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  751. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  752. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  753. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  754. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  755. },
  756. constraints: table =>
  757. {
  758. table.PrimaryKey("PK_TSYS_Message", x => x.C_Code);
  759. table.ForeignKey(
  760. name: "FK_TSYS_Message_TSYS_User_C_CreateBy",
  761. column: x => x.C_CreateBy,
  762. principalTable: "TSYS_User",
  763. principalColumn: "C_UserID",
  764. onDelete: ReferentialAction.Restrict);
  765. table.ForeignKey(
  766. name: "FK_TSYS_Message_TSYS_User_C_LastUpdatedBy",
  767. column: x => x.C_LastUpdatedBy,
  768. principalTable: "TSYS_User",
  769. principalColumn: "C_UserID",
  770. onDelete: ReferentialAction.Restrict);
  771. table.ForeignKey(
  772. name: "FK_TSYS_Message_TSYS_User_C_UserID",
  773. column: x => x.C_UserID,
  774. principalTable: "TSYS_User",
  775. principalColumn: "C_UserID",
  776. onDelete: ReferentialAction.Restrict);
  777. });
  778. migrationBuilder.CreateTable(
  779. name: "TSYS_Role",
  780. columns: table => new
  781. {
  782. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  783. C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  784. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  785. C_Description = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  786. I_Sort = table.Column<int>(type: "int", nullable: true),
  787. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  788. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  789. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  790. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  791. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  792. },
  793. constraints: table =>
  794. {
  795. table.PrimaryKey("PK_TSYS_Role", x => x.C_Code);
  796. table.ForeignKey(
  797. name: "FK_TSYS_Role_TSYS_User_C_CreateBy",
  798. column: x => x.C_CreateBy,
  799. principalTable: "TSYS_User",
  800. principalColumn: "C_UserID",
  801. onDelete: ReferentialAction.Restrict);
  802. table.ForeignKey(
  803. name: "FK_TSYS_Role_TSYS_User_C_LastUpdatedBy",
  804. column: x => x.C_LastUpdatedBy,
  805. principalTable: "TSYS_User",
  806. principalColumn: "C_UserID",
  807. onDelete: ReferentialAction.Restrict);
  808. });
  809. migrationBuilder.CreateTable(
  810. name: "TSYS_Version",
  811. columns: table => new
  812. {
  813. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  814. C_AppCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  815. C_VersionCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  816. C_UpdateContent = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true),
  817. C_DownloadURL = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true),
  818. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  819. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  820. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  821. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  822. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  823. },
  824. constraints: table =>
  825. {
  826. table.PrimaryKey("PK_TSYS_Version", x => x.C_ID);
  827. table.ForeignKey(
  828. name: "FK_TSYS_Version_TSYS_User_C_CreateBy",
  829. column: x => x.C_CreateBy,
  830. principalTable: "TSYS_User",
  831. principalColumn: "C_UserID",
  832. onDelete: ReferentialAction.Restrict);
  833. table.ForeignKey(
  834. name: "FK_TSYS_Version_TSYS_User_C_LastUpdatedBy",
  835. column: x => x.C_LastUpdatedBy,
  836. principalTable: "TSYS_User",
  837. principalColumn: "C_UserID",
  838. onDelete: ReferentialAction.Restrict);
  839. });
  840. migrationBuilder.CreateTable(
  841. name: "TBDM_Area",
  842. columns: table => new
  843. {
  844. C_Code = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
  845. C_CityCode = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
  846. C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  847. I_Sort = table.Column<int>(type: "int", nullable: true),
  848. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  849. },
  850. constraints: table =>
  851. {
  852. table.PrimaryKey("PK_TBDM_Area", x => x.C_Code);
  853. table.ForeignKey(
  854. name: "FK_TBDM_Area_TBDM_City_C_CityCode",
  855. column: x => x.C_CityCode,
  856. principalTable: "TBDM_City",
  857. principalColumn: "C_Code",
  858. onDelete: ReferentialAction.Restrict);
  859. });
  860. migrationBuilder.CreateTable(
  861. name: "TISP_SpotContent",
  862. columns: table => new
  863. {
  864. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  865. C_ContentCode = table.Column<Guid>(type: "char(36)", nullable: false),
  866. C_SpotCode = table.Column<Guid>(type: "char(36)", nullable: false),
  867. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  868. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  869. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  870. },
  871. constraints: table =>
  872. {
  873. table.PrimaryKey("PK_TISP_SpotContent", x => x.C_ID);
  874. table.ForeignKey(
  875. name: "FK_TISP_SpotContent_TISP_Content_C_ContentCode",
  876. column: x => x.C_ContentCode,
  877. principalTable: "TISP_Content",
  878. principalColumn: "C_ID",
  879. onDelete: ReferentialAction.Restrict);
  880. table.ForeignKey(
  881. name: "FK_TISP_SpotContent_TSYS_User_C_CreateBy",
  882. column: x => x.C_CreateBy,
  883. principalTable: "TSYS_User",
  884. principalColumn: "C_UserID",
  885. onDelete: ReferentialAction.Restrict);
  886. });
  887. migrationBuilder.CreateTable(
  888. name: "TISP_ContentGroupItem",
  889. columns: table => new
  890. {
  891. G_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  892. G_ContentGroupCode = table.Column<Guid>(type: "char(36)", nullable: false),
  893. G_ContentCode = table.Column<Guid>(type: "char(36)", nullable: false)
  894. },
  895. constraints: table =>
  896. {
  897. table.PrimaryKey("PK_TISP_ContentGroupItem", x => x.G_ID);
  898. table.ForeignKey(
  899. name: "FK_TISP_ContentGroupItem_TISP_Content_G_ContentCode",
  900. column: x => x.G_ContentCode,
  901. principalTable: "TISP_Content",
  902. principalColumn: "C_ID",
  903. onDelete: ReferentialAction.Restrict);
  904. table.ForeignKey(
  905. name: "FK_TISP_ContentGroupItem_TISP_ContentGroup_G_ContentGroupCode",
  906. column: x => x.G_ContentGroupCode,
  907. principalTable: "TISP_ContentGroup",
  908. principalColumn: "G_ID",
  909. onDelete: ReferentialAction.Restrict);
  910. });
  911. migrationBuilder.CreateTable(
  912. name: "TISP_Record",
  913. columns: table => new
  914. {
  915. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  916. C_SpotCode = table.Column<Guid>(type: "char(36)", nullable: false),
  917. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  918. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  919. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  920. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  921. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  922. },
  923. constraints: table =>
  924. {
  925. table.PrimaryKey("PK_TISP_Record", x => x.C_ID);
  926. table.ForeignKey(
  927. name: "FK_TISP_Record_TISP_Spot_C_SpotCode",
  928. column: x => x.C_SpotCode,
  929. principalTable: "TISP_Spot",
  930. principalColumn: "C_Code",
  931. onDelete: ReferentialAction.Restrict);
  932. table.ForeignKey(
  933. name: "FK_TISP_Record_TSYS_User_C_CreateBy",
  934. column: x => x.C_CreateBy,
  935. principalTable: "TSYS_User",
  936. principalColumn: "C_UserID",
  937. onDelete: ReferentialAction.Restrict);
  938. table.ForeignKey(
  939. name: "FK_TISP_Record_TSYS_User_C_LastUpdatedBy",
  940. column: x => x.C_LastUpdatedBy,
  941. principalTable: "TSYS_User",
  942. principalColumn: "C_UserID",
  943. onDelete: ReferentialAction.Restrict);
  944. });
  945. migrationBuilder.CreateTable(
  946. name: "TISP_SpotRegion",
  947. columns: table => new
  948. {
  949. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  950. C_RegionCode = table.Column<Guid>(type: "char(36)", nullable: false),
  951. C_SpotCode = table.Column<Guid>(type: "char(36)", nullable: false),
  952. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  953. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  954. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  955. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  956. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  957. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  958. },
  959. constraints: table =>
  960. {
  961. table.PrimaryKey("PK_TISP_SpotRegion", x => x.C_ID);
  962. table.ForeignKey(
  963. name: "FK_TISP_SpotRegion_TISP_Region_C_RegionCode",
  964. column: x => x.C_RegionCode,
  965. principalTable: "TISP_Region",
  966. principalColumn: "C_ID",
  967. onDelete: ReferentialAction.Restrict);
  968. table.ForeignKey(
  969. name: "FK_TISP_SpotRegion_TISP_Spot_C_SpotCode",
  970. column: x => x.C_SpotCode,
  971. principalTable: "TISP_Spot",
  972. principalColumn: "C_Code",
  973. onDelete: ReferentialAction.Restrict);
  974. table.ForeignKey(
  975. name: "FK_TISP_SpotRegion_TSYS_User_C_CreateBy",
  976. column: x => x.C_CreateBy,
  977. principalTable: "TSYS_User",
  978. principalColumn: "C_UserID",
  979. onDelete: ReferentialAction.Restrict);
  980. table.ForeignKey(
  981. name: "FK_TISP_SpotRegion_TSYS_User_C_LastUpdatedBy",
  982. column: x => x.C_LastUpdatedBy,
  983. principalTable: "TSYS_User",
  984. principalColumn: "C_UserID",
  985. onDelete: ReferentialAction.Restrict);
  986. });
  987. migrationBuilder.CreateTable(
  988. name: "TISP_SpotRoute",
  989. columns: table => new
  990. {
  991. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  992. C_RouteCode = table.Column<Guid>(type: "char(36)", nullable: false),
  993. C_SpotCode = table.Column<Guid>(type: "char(36)", nullable: false),
  994. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  995. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  996. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  997. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: false),
  998. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  999. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false)
  1000. },
  1001. constraints: table =>
  1002. {
  1003. table.PrimaryKey("PK_TISP_SpotRoute", x => x.C_ID);
  1004. table.ForeignKey(
  1005. name: "FK_TISP_SpotRoute_TISP_Route_C_RouteCode",
  1006. column: x => x.C_RouteCode,
  1007. principalTable: "TISP_Route",
  1008. principalColumn: "C_ID",
  1009. onDelete: ReferentialAction.Restrict);
  1010. table.ForeignKey(
  1011. name: "FK_TISP_SpotRoute_TISP_Spot_C_SpotCode",
  1012. column: x => x.C_SpotCode,
  1013. principalTable: "TISP_Spot",
  1014. principalColumn: "C_Code",
  1015. onDelete: ReferentialAction.Restrict);
  1016. table.ForeignKey(
  1017. name: "FK_TISP_SpotRoute_TSYS_User_C_CreateBy",
  1018. column: x => x.C_CreateBy,
  1019. principalTable: "TSYS_User",
  1020. principalColumn: "C_UserID",
  1021. onDelete: ReferentialAction.Restrict);
  1022. table.ForeignKey(
  1023. name: "FK_TISP_SpotRoute_TSYS_User_C_LastUpdatedBy",
  1024. column: x => x.C_LastUpdatedBy,
  1025. principalTable: "TSYS_User",
  1026. principalColumn: "C_UserID",
  1027. onDelete: ReferentialAction.Restrict);
  1028. });
  1029. migrationBuilder.CreateTable(
  1030. name: "TISP_SpotUser",
  1031. columns: table => new
  1032. {
  1033. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  1034. C_UserCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1035. C_SpotCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1036. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1037. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1038. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  1039. },
  1040. constraints: table =>
  1041. {
  1042. table.PrimaryKey("PK_TISP_SpotUser", x => x.C_ID);
  1043. table.ForeignKey(
  1044. name: "FK_TISP_SpotUser_TISP_Spot_C_SpotCode",
  1045. column: x => x.C_SpotCode,
  1046. principalTable: "TISP_Spot",
  1047. principalColumn: "C_Code",
  1048. onDelete: ReferentialAction.Restrict);
  1049. table.ForeignKey(
  1050. name: "FK_TISP_SpotUser_TSYS_User_C_CreateBy",
  1051. column: x => x.C_CreateBy,
  1052. principalTable: "TSYS_User",
  1053. principalColumn: "C_UserID",
  1054. onDelete: ReferentialAction.Restrict);
  1055. table.ForeignKey(
  1056. name: "FK_TISP_SpotUser_TSYS_User_C_UserCode",
  1057. column: x => x.C_UserCode,
  1058. principalTable: "TSYS_User",
  1059. principalColumn: "C_UserID",
  1060. onDelete: ReferentialAction.Restrict);
  1061. });
  1062. migrationBuilder.CreateTable(
  1063. name: "TSYS_Org",
  1064. columns: table => new
  1065. {
  1066. K_ID = table.Column<int>(type: "int", nullable: false)
  1067. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1068. C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1069. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1070. C_Name = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
  1071. C_SName = table.Column<string>(type: "varchar(16) CHARACTER SET utf8mb4", maxLength: 16, nullable: true),
  1072. C_Lname = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", maxLength: 2550, nullable: true),
  1073. C_Level = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: false),
  1074. C_ParentCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1075. C_Type = table.Column<Guid>(type: "char(36)", nullable: false),
  1076. C_Phone = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1077. C_Linker = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1078. C_GIS = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1079. I_Sort = table.Column<int>(type: "int", nullable: false),
  1080. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1081. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1082. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1083. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1084. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1085. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false),
  1086. //StoreOrgC_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", nullable: true),
  1087. //StoreOrgC_OrgCode = table.Column<Guid>(type: "char(36)", nullable: true)
  1088. },
  1089. constraints: table =>
  1090. {
  1091. //table.PrimaryKey("PK_TSYS_Org", x => x.K_ID);
  1092. //table.ForeignKey(
  1093. // name: "FK_TSYS_Org_TPNT_StoreOrg_StoreOrgC_StoreCode_StoreOrgC_OrgCode",
  1094. // columns: x => new { x.StoreOrgC_StoreCode, x.StoreOrgC_OrgCode },
  1095. // principalTable: "TPNT_StoreOrg",
  1096. // principalColumns: new[] { "C_StoreCode", "C_OrgCode" },
  1097. // onDelete: ReferentialAction.Restrict);
  1098. });
  1099. migrationBuilder.CreateTable(
  1100. name: "TPRD_ProdSKU",
  1101. columns: table => new
  1102. {
  1103. C_SKUCode = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  1104. C_TypeCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1105. C_Name = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
  1106. C_Spec = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1107. C_Brand = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true),
  1108. C_Vender = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
  1109. C_ProdArea = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1110. C_Unit = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1111. C_ImagePath = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1112. C_IconPath = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1113. I_MinStock = table.Column<int>(type: "int", nullable: false),
  1114. I_ValiDays = table.Column<int>(type: "int", nullable: true),
  1115. I_AlarmDays = table.Column<int>(type: "int", nullable: true),
  1116. I_Sort = table.Column<int>(type: "int", nullable: true),
  1117. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1118. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1119. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1120. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1121. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1122. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  1123. },
  1124. constraints: table =>
  1125. {
  1126. table.PrimaryKey("PK_TPRD_ProdSKU", x => x.C_SKUCode);
  1127. table.ForeignKey(
  1128. name: "FK_TPRD_ProdSKU_TPRD_Type_C_TypeCode",
  1129. column: x => x.C_TypeCode,
  1130. principalTable: "TPRD_Type",
  1131. principalColumn: "C_Code",
  1132. onDelete: ReferentialAction.Restrict);
  1133. table.ForeignKey(
  1134. name: "FK_TPRD_ProdSKU_TSYS_User_C_CreateBy",
  1135. column: x => x.C_CreateBy,
  1136. principalTable: "TSYS_User",
  1137. principalColumn: "C_UserID",
  1138. onDelete: ReferentialAction.Restrict);
  1139. table.ForeignKey(
  1140. name: "FK_TPRD_ProdSKU_TSYS_User_C_LastUpdatedBy",
  1141. column: x => x.C_LastUpdatedBy,
  1142. principalTable: "TSYS_User",
  1143. principalColumn: "C_UserID",
  1144. onDelete: ReferentialAction.Restrict);
  1145. });
  1146. migrationBuilder.CreateTable(
  1147. name: "TSYS_License",
  1148. columns: table => new
  1149. {
  1150. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  1151. C_TypeCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1152. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1153. C_Name = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  1154. I_MemberQty = table.Column<int>(type: "int", nullable: false),
  1155. I_SpotQty = table.Column<int>(type: "int", nullable: false),
  1156. C_FilePath = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: false),
  1157. D_StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1158. D_EndDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1159. I_Sort = table.Column<int>(type: "int", nullable: true),
  1160. C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1161. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1162. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1163. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1164. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1165. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false),
  1166. UsersCreateByC_UserID = table.Column<Guid>(type: "char(36)", nullable: true)
  1167. },
  1168. constraints: table =>
  1169. {
  1170. table.PrimaryKey("PK_TSYS_License", x => x.C_ID);
  1171. table.ForeignKey(
  1172. name: "FK_TSYS_License_TSYS_LicenseType_C_TypeCode",
  1173. column: x => x.C_TypeCode,
  1174. principalTable: "TSYS_LicenseType",
  1175. principalColumn: "C_Code",
  1176. onDelete: ReferentialAction.Restrict);
  1177. table.ForeignKey(
  1178. name: "FK_TSYS_License_TSYS_User_UsersCreateByC_UserID",
  1179. column: x => x.UsersCreateByC_UserID,
  1180. principalTable: "TSYS_User",
  1181. principalColumn: "C_UserID",
  1182. onDelete: ReferentialAction.Restrict);
  1183. });
  1184. migrationBuilder.CreateTable(
  1185. name: "TSYS_LicenseTypePriv",
  1186. columns: table => new
  1187. {
  1188. C_LicenseTypeCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1189. C_PrivilegeCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1190. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1191. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  1192. },
  1193. constraints: table =>
  1194. {
  1195. table.PrimaryKey("PK_TSYS_LicenseTypePriv", x => new { x.C_LicenseTypeCode, x.C_PrivilegeCode });
  1196. table.ForeignKey(
  1197. name: "FK_TSYS_LicenseTypePriv_TSYS_LicenseType_C_LicenseTypeCode",
  1198. column: x => x.C_LicenseTypeCode,
  1199. principalTable: "TSYS_LicenseType",
  1200. principalColumn: "C_Code",
  1201. onDelete: ReferentialAction.Restrict);
  1202. table.ForeignKey(
  1203. name: "FK_TSYS_LicenseTypePriv_TSYS_Priv_C_PrivilegeCode",
  1204. column: x => x.C_PrivilegeCode,
  1205. principalTable: "TSYS_Priv",
  1206. principalColumn: "C_Code",
  1207. onDelete: ReferentialAction.Restrict);
  1208. table.ForeignKey(
  1209. name: "FK_TSYS_LicenseTypePriv_TSYS_User_C_CreateBy",
  1210. column: x => x.C_CreateBy,
  1211. principalTable: "TSYS_User",
  1212. principalColumn: "C_UserID",
  1213. onDelete: ReferentialAction.Restrict);
  1214. });
  1215. migrationBuilder.CreateTable(
  1216. name: "TSYS_RolePriv",
  1217. columns: table => new
  1218. {
  1219. C_RoleCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1220. C_PrivilegeCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1221. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1222. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1223. I_Type = table.Column<int>(type: "int", nullable: false)
  1224. },
  1225. constraints: table =>
  1226. {
  1227. table.PrimaryKey("PK_TSYS_RolePriv", x => new { x.C_RoleCode, x.C_PrivilegeCode });
  1228. table.ForeignKey(
  1229. name: "FK_TSYS_RolePriv_TSYS_Priv_C_PrivilegeCode",
  1230. column: x => x.C_PrivilegeCode,
  1231. principalTable: "TSYS_Priv",
  1232. principalColumn: "C_Code",
  1233. onDelete: ReferentialAction.Restrict);
  1234. table.ForeignKey(
  1235. name: "FK_TSYS_RolePriv_TSYS_Role_C_RoleCode",
  1236. column: x => x.C_RoleCode,
  1237. principalTable: "TSYS_Role",
  1238. principalColumn: "C_Code",
  1239. onDelete: ReferentialAction.Restrict);
  1240. table.ForeignKey(
  1241. name: "FK_TSYS_RolePriv_TSYS_User_C_CreateBy",
  1242. column: x => x.C_CreateBy,
  1243. principalTable: "TSYS_User",
  1244. principalColumn: "C_UserID",
  1245. onDelete: ReferentialAction.Restrict);
  1246. });
  1247. migrationBuilder.CreateTable(
  1248. name: "TSYS_UserRole",
  1249. columns: table => new
  1250. {
  1251. C_UserCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1252. C_RoleCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1253. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1254. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  1255. },
  1256. constraints: table =>
  1257. {
  1258. table.PrimaryKey("PK_TSYS_UserRole", x => new { x.C_UserCode, x.C_RoleCode });
  1259. table.ForeignKey(
  1260. name: "FK_TSYS_UserRole_TSYS_Role_C_RoleCode",
  1261. column: x => x.C_RoleCode,
  1262. principalTable: "TSYS_Role",
  1263. principalColumn: "C_Code",
  1264. onDelete: ReferentialAction.Restrict);
  1265. table.ForeignKey(
  1266. name: "FK_TSYS_UserRole_TSYS_User_C_CreateBy",
  1267. column: x => x.C_CreateBy,
  1268. principalTable: "TSYS_User",
  1269. principalColumn: "C_UserID",
  1270. onDelete: ReferentialAction.Restrict);
  1271. table.ForeignKey(
  1272. name: "FK_TSYS_UserRole_TSYS_User_C_UserCode",
  1273. column: x => x.C_UserCode,
  1274. principalTable: "TSYS_User",
  1275. principalColumn: "C_UserID",
  1276. onDelete: ReferentialAction.Restrict);
  1277. });
  1278. migrationBuilder.CreateTable(
  1279. name: "TISP_RecordItem",
  1280. columns: table => new
  1281. {
  1282. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  1283. C_ContentCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1284. C_RecordCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1285. C_InspectionContent = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  1286. C_Remark = table.Column<string>(type: "longtext CHARACTER SET utf8mb4", nullable: true),
  1287. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false),
  1288. C_CreateBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  1289. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1290. C_LastUpdatedBy = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false),
  1291. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  1292. },
  1293. constraints: table =>
  1294. {
  1295. table.PrimaryKey("PK_TISP_RecordItem", x => x.C_ID);
  1296. table.ForeignKey(
  1297. name: "FK_TISP_RecordItem_TISP_Content_C_ContentCode",
  1298. column: x => x.C_ContentCode,
  1299. principalTable: "TISP_Content",
  1300. principalColumn: "C_ID",
  1301. onDelete: ReferentialAction.Restrict);
  1302. table.ForeignKey(
  1303. name: "FK_TISP_RecordItem_TISP_Record_C_RecordCode",
  1304. column: x => x.C_RecordCode,
  1305. principalTable: "TISP_Record",
  1306. principalColumn: "C_ID",
  1307. onDelete: ReferentialAction.Restrict);
  1308. table.ForeignKey(
  1309. name: "FK_TISP_RecordItem_TSYS_User_C_CreateBy",
  1310. column: x => x.C_CreateBy,
  1311. principalTable: "TSYS_User",
  1312. principalColumn: "C_UserID",
  1313. onDelete: ReferentialAction.Restrict);
  1314. table.ForeignKey(
  1315. name: "FK_TISP_RecordItem_TSYS_User_C_LastUpdatedBy",
  1316. column: x => x.C_LastUpdatedBy,
  1317. principalTable: "TSYS_User",
  1318. principalColumn: "C_UserID",
  1319. onDelete: ReferentialAction.Restrict);
  1320. });
  1321. migrationBuilder.CreateTable(
  1322. name: "TPNT_Store",
  1323. columns: table => new
  1324. {
  1325. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  1326. C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1327. C_AreaCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1328. C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1329. C_Name = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
  1330. C_SName = table.Column<string>(type: "varchar(16) CHARACTER SET utf8mb4", maxLength: 16, nullable: true),
  1331. C_TypeCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1332. C_Address = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1333. C_GPS = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
  1334. I_Sort = table.Column<int>(type: "int", nullable: false),
  1335. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1336. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1337. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1338. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1339. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1340. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false),
  1341. LicenseC_ID = table.Column<Guid>(type: "char(36)", nullable: true),
  1342. StoreOrgC_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", nullable: true),
  1343. StoreOrgC_OrgCode = table.Column<Guid>(type: "char(36)", nullable: true)
  1344. },
  1345. constraints: table =>
  1346. {
  1347. table.PrimaryKey("PK_TPNT_Store", x => x.C_ID);
  1348. table.ForeignKey(
  1349. name: "FK_TPNT_Store_TBDM_Area_C_AreaCode",
  1350. column: x => x.C_AreaCode,
  1351. principalTable: "TBDM_Area",
  1352. principalColumn: "C_Code",
  1353. onDelete: ReferentialAction.Restrict);
  1354. table.ForeignKey(
  1355. name: "FK_TPNT_Store_TPNT_StoreOrg_StoreOrgC_StoreCode_StoreOrgC_OrgCo~",
  1356. columns: x => new { x.StoreOrgC_StoreCode, x.StoreOrgC_OrgCode },
  1357. principalTable: "TPNT_StoreOrg",
  1358. principalColumns: new[] { "C_StoreCode", "C_OrgCode" },
  1359. onDelete: ReferentialAction.Restrict);
  1360. table.ForeignKey(
  1361. name: "FK_TPNT_Store_TPNT_Type_C_TypeCode",
  1362. column: x => x.C_TypeCode,
  1363. principalTable: "TPNT_Type",
  1364. principalColumn: "C_Code",
  1365. onDelete: ReferentialAction.Restrict);
  1366. table.ForeignKey(
  1367. name: "FK_TPNT_Store_TSYS_License_LicenseC_ID",
  1368. column: x => x.LicenseC_ID,
  1369. principalTable: "TSYS_License",
  1370. principalColumn: "C_ID",
  1371. onDelete: ReferentialAction.Restrict);
  1372. table.ForeignKey(
  1373. name: "FK_TPNT_Store_TSYS_User_C_CreateBy",
  1374. column: x => x.C_CreateBy,
  1375. principalTable: "TSYS_User",
  1376. principalColumn: "C_UserID",
  1377. onDelete: ReferentialAction.Restrict);
  1378. table.ForeignKey(
  1379. name: "FK_TPNT_Store_TSYS_User_C_LastUpdatedBy",
  1380. column: x => x.C_LastUpdatedBy,
  1381. principalTable: "TSYS_User",
  1382. principalColumn: "C_UserID",
  1383. onDelete: ReferentialAction.Restrict);
  1384. });
  1385. migrationBuilder.CreateTable(
  1386. name: "TISP_RecordImage",
  1387. columns: table => new
  1388. {
  1389. C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
  1390. C_RecordItemCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1391. C_ImageURL = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false),
  1392. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  1393. },
  1394. constraints: table =>
  1395. {
  1396. table.PrimaryKey("PK_TISP_RecordImage", x => x.C_ID);
  1397. table.ForeignKey(
  1398. name: "FK_TISP_RecordImage_TISP_RecordItem_C_RecordItemCode",
  1399. column: x => x.C_RecordItemCode,
  1400. principalTable: "TISP_RecordItem",
  1401. principalColumn: "C_ID",
  1402. onDelete: ReferentialAction.Restrict);
  1403. });
  1404. migrationBuilder.CreateTable(
  1405. name: "TPNT_Area",
  1406. columns: table => new
  1407. {
  1408. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  1409. C_StoreCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1410. C_Name = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
  1411. C_SName = table.Column<string>(type: "varchar(16) CHARACTER SET utf8mb4", maxLength: 16, nullable: true),
  1412. C_ImageUrl = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
  1413. I_Sort = table.Column<int>(type: "int", nullable: true),
  1414. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1415. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1416. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1417. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1418. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1419. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  1420. },
  1421. constraints: table =>
  1422. {
  1423. table.PrimaryKey("PK_TPNT_Area", x => x.C_Code);
  1424. table.ForeignKey(
  1425. name: "FK_TPNT_Area_TPNT_Store_C_StoreCode",
  1426. column: x => x.C_StoreCode,
  1427. principalTable: "TPNT_Store",
  1428. principalColumn: "C_ID",
  1429. onDelete: ReferentialAction.Restrict);
  1430. table.ForeignKey(
  1431. name: "FK_TPNT_Area_TSYS_User_C_CreateBy",
  1432. column: x => x.C_CreateBy,
  1433. principalTable: "TSYS_User",
  1434. principalColumn: "C_UserID",
  1435. onDelete: ReferentialAction.Restrict);
  1436. table.ForeignKey(
  1437. name: "FK_TPNT_Area_TSYS_User_C_LastUpdatedBy",
  1438. column: x => x.C_LastUpdatedBy,
  1439. principalTable: "TSYS_User",
  1440. principalColumn: "C_UserID",
  1441. onDelete: ReferentialAction.Restrict);
  1442. });
  1443. migrationBuilder.CreateTable(
  1444. name: "TPRD_Product",
  1445. columns: table => new
  1446. {
  1447. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  1448. C_QRCode = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
  1449. C_SKUCode = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
  1450. C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1451. C_DeviceCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1452. C_SpotCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1453. C_AreaCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1454. F_Map_X = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
  1455. F_Map_Y = table.Column<decimal>(type: "decimal(12,2)", nullable: true),
  1456. D_ProdDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1457. D_ValiDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1458. C_ImageUrl = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
  1459. D_LastISP = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1460. I_IsAlarm = table.Column<int>(type: "int", nullable: true),
  1461. C_AlarmMsg = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1462. I_Sort = table.Column<int>(type: "int", nullable: true),
  1463. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1464. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1465. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1466. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1467. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1468. I_Status = table.Column<int>(type: "int", nullable: false)
  1469. },
  1470. constraints: table =>
  1471. {
  1472. table.PrimaryKey("PK_TPRD_Product", x => x.C_Code);
  1473. table.ForeignKey(
  1474. name: "FK_TPRD_Product_TPRD_ProdSKU_C_SKUCode",
  1475. column: x => x.C_SKUCode,
  1476. principalTable: "TPRD_ProdSKU",
  1477. principalColumn: "C_SKUCode",
  1478. onDelete: ReferentialAction.Restrict);
  1479. table.ForeignKey(
  1480. name: "FK_TPRD_Product_TSYS_User_C_CreateBy",
  1481. column: x => x.C_CreateBy,
  1482. principalTable: "TSYS_User",
  1483. principalColumn: "C_UserID",
  1484. onDelete: ReferentialAction.Restrict);
  1485. table.ForeignKey(
  1486. name: "FK_TPRD_Product_TSYS_User_C_LastUpdatedBy",
  1487. column: x => x.C_LastUpdatedBy,
  1488. principalTable: "TSYS_User",
  1489. principalColumn: "C_UserID",
  1490. onDelete: ReferentialAction.Restrict);
  1491. });
  1492. migrationBuilder.CreateTable(
  1493. name: "TDEV_Device",
  1494. columns: table => new
  1495. {
  1496. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  1497. C_ProductCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1498. C_MachineCode = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
  1499. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1500. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1501. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
  1502. C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
  1503. D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
  1504. C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
  1505. },
  1506. constraints: table =>
  1507. {
  1508. table.PrimaryKey("PK_TDEV_Device", x => x.C_Code);
  1509. table.ForeignKey(
  1510. name: "FK_TDEV_Device_TPRD_Product_C_ProductCode",
  1511. column: x => x.C_ProductCode,
  1512. principalTable: "TPRD_Product",
  1513. principalColumn: "C_Code",
  1514. onDelete: ReferentialAction.Restrict);
  1515. table.ForeignKey(
  1516. name: "FK_TDEV_Device_TSYS_User_C_CreateBy",
  1517. column: x => x.C_CreateBy,
  1518. principalTable: "TSYS_User",
  1519. principalColumn: "C_UserID",
  1520. onDelete: ReferentialAction.Restrict);
  1521. table.ForeignKey(
  1522. name: "FK_TDEV_Device_TSYS_User_C_LastUpdatedBy",
  1523. column: x => x.C_LastUpdatedBy,
  1524. principalTable: "TSYS_User",
  1525. principalColumn: "C_UserID",
  1526. onDelete: ReferentialAction.Restrict);
  1527. });
  1528. migrationBuilder.CreateTable(
  1529. name: "TPRD_Log",
  1530. columns: table => new
  1531. {
  1532. C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
  1533. C_ProductCode = table.Column<Guid>(type: "char(36)", nullable: false),
  1534. I_Type = table.Column<int>(type: "int", nullable: false),
  1535. C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
  1536. C_DeviceCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1537. C_SpotCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
  1538. C_AlarmMsg = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1539. C_Remark = table.Column<string>(type: "varchar(1024) CHARACTER SET utf8mb4", maxLength: 1024, nullable: true),
  1540. C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
  1541. D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
  1542. },
  1543. constraints: table =>
  1544. {
  1545. table.PrimaryKey("PK_TPRD_Log", x => x.C_Code);
  1546. table.ForeignKey(
  1547. name: "FK_TPRD_Log_TPRD_Product_C_ProductCode",
  1548. column: x => x.C_ProductCode,
  1549. principalTable: "TPRD_Product",
  1550. principalColumn: "C_Code",
  1551. onDelete: ReferentialAction.Restrict);
  1552. table.ForeignKey(
  1553. name: "FK_TPRD_Log_TSYS_User_C_CreateBy",
  1554. column: x => x.C_CreateBy,
  1555. principalTable: "TSYS_User",
  1556. principalColumn: "C_UserID",
  1557. onDelete: ReferentialAction.Restrict);
  1558. });
  1559. migrationBuilder.CreateIndex(
  1560. name: "IX_TaskInfoDto_TasksQzId",
  1561. table: "TaskInfoDto",
  1562. column: "TasksQzId");
  1563. migrationBuilder.CreateIndex(
  1564. name: "IX_TBDM_Area_C_CityCode",
  1565. table: "TBDM_Area",
  1566. column: "C_CityCode");
  1567. migrationBuilder.CreateIndex(
  1568. name: "IX_TBDM_City_C_ProvCode",
  1569. table: "TBDM_City",
  1570. column: "C_ProvCode");
  1571. migrationBuilder.CreateIndex(
  1572. name: "IX_TBDM_CodeDetail_C_CreateBy",
  1573. table: "TBDM_CodeDetail",
  1574. column: "C_CreateBy");
  1575. migrationBuilder.CreateIndex(
  1576. name: "IX_TBDM_CodeDetail_C_LastUpdatedBy",
  1577. table: "TBDM_CodeDetail",
  1578. column: "C_LastUpdatedBy");
  1579. migrationBuilder.CreateIndex(
  1580. name: "IX_TBDM_CodeMain_C_CreateBy",
  1581. table: "TBDM_CodeMain",
  1582. column: "C_CreateBy");
  1583. migrationBuilder.CreateIndex(
  1584. name: "IX_TBDM_CodeMain_C_LastUpdatedBy",
  1585. table: "TBDM_CodeMain",
  1586. column: "C_LastUpdatedBy");
  1587. migrationBuilder.CreateIndex(
  1588. name: "IX_TDEV_DevAlertConfig_C_CreateBy",
  1589. table: "TDEV_DevAlertConfig",
  1590. column: "C_CreateBy");
  1591. migrationBuilder.CreateIndex(
  1592. name: "IX_TDEV_DevAlertConfig_C_LastUpdatedBy",
  1593. table: "TDEV_DevAlertConfig",
  1594. column: "C_LastUpdatedBy");
  1595. migrationBuilder.CreateIndex(
  1596. name: "IX_TDEV_DevDataConfig_C_CreateBy",
  1597. table: "TDEV_DevDataConfig",
  1598. column: "C_CreateBy");
  1599. migrationBuilder.CreateIndex(
  1600. name: "IX_TDEV_DevDataConfig_C_LastUpdatedBy",
  1601. table: "TDEV_DevDataConfig",
  1602. column: "C_LastUpdatedBy");
  1603. migrationBuilder.CreateIndex(
  1604. name: "IX_TDEV_Device_C_CreateBy",
  1605. table: "TDEV_Device",
  1606. column: "C_CreateBy");
  1607. migrationBuilder.CreateIndex(
  1608. name: "IX_TDEV_Device_C_LastUpdatedBy",
  1609. table: "TDEV_Device",
  1610. column: "C_LastUpdatedBy");
  1611. migrationBuilder.CreateIndex(
  1612. name: "IX_TDEV_Device_C_ProductCode",
  1613. table: "TDEV_Device",
  1614. column: "C_ProductCode");
  1615. migrationBuilder.CreateIndex(
  1616. name: "IX_TISP_Content_C_CreateBy",
  1617. table: "TISP_Content",
  1618. column: "C_CreateBy");
  1619. migrationBuilder.CreateIndex(
  1620. name: "IX_TISP_Content_C_LastUpdatedBy",
  1621. table: "TISP_Content",
  1622. column: "C_LastUpdatedBy");
  1623. migrationBuilder.CreateIndex(
  1624. name: "IX_TISP_ContentGroup_G_CreateBy",
  1625. table: "TISP_ContentGroup",
  1626. column: "G_CreateBy");
  1627. migrationBuilder.CreateIndex(
  1628. name: "IX_TISP_ContentGroup_G_LastUpdatedBy",
  1629. table: "TISP_ContentGroup",
  1630. column: "G_LastUpdatedBy");
  1631. migrationBuilder.CreateIndex(
  1632. name: "IX_TISP_ContentGroupItem_G_ContentCode",
  1633. table: "TISP_ContentGroupItem",
  1634. column: "G_ContentCode");
  1635. migrationBuilder.CreateIndex(
  1636. name: "IX_TISP_ContentGroupItem_G_ContentGroupCode",
  1637. table: "TISP_ContentGroupItem",
  1638. column: "G_ContentGroupCode");
  1639. migrationBuilder.CreateIndex(
  1640. name: "IX_TISP_Record_C_CreateBy",
  1641. table: "TISP_Record",
  1642. column: "C_CreateBy");
  1643. migrationBuilder.CreateIndex(
  1644. name: "IX_TISP_Record_C_LastUpdatedBy",
  1645. table: "TISP_Record",
  1646. column: "C_LastUpdatedBy");
  1647. migrationBuilder.CreateIndex(
  1648. name: "IX_TISP_Record_C_SpotCode",
  1649. table: "TISP_Record",
  1650. column: "C_SpotCode");
  1651. migrationBuilder.CreateIndex(
  1652. name: "IX_TISP_RecordImage_C_RecordItemCode",
  1653. table: "TISP_RecordImage",
  1654. column: "C_RecordItemCode");
  1655. migrationBuilder.CreateIndex(
  1656. name: "IX_TISP_RecordItem_C_ContentCode",
  1657. table: "TISP_RecordItem",
  1658. column: "C_ContentCode");
  1659. migrationBuilder.CreateIndex(
  1660. name: "IX_TISP_RecordItem_C_CreateBy",
  1661. table: "TISP_RecordItem",
  1662. column: "C_CreateBy");
  1663. migrationBuilder.CreateIndex(
  1664. name: "IX_TISP_RecordItem_C_LastUpdatedBy",
  1665. table: "TISP_RecordItem",
  1666. column: "C_LastUpdatedBy");
  1667. migrationBuilder.CreateIndex(
  1668. name: "IX_TISP_RecordItem_C_RecordCode",
  1669. table: "TISP_RecordItem",
  1670. column: "C_RecordCode");
  1671. migrationBuilder.CreateIndex(
  1672. name: "IX_TISP_Region_C_CreateBy",
  1673. table: "TISP_Region",
  1674. column: "C_CreateBy");
  1675. migrationBuilder.CreateIndex(
  1676. name: "IX_TISP_Region_C_LastUpdatedBy",
  1677. table: "TISP_Region",
  1678. column: "C_LastUpdatedBy");
  1679. migrationBuilder.CreateIndex(
  1680. name: "IX_TISP_Route_C_CreateBy",
  1681. table: "TISP_Route",
  1682. column: "C_CreateBy");
  1683. migrationBuilder.CreateIndex(
  1684. name: "IX_TISP_Route_C_LastUpdatedBy",
  1685. table: "TISP_Route",
  1686. column: "C_LastUpdatedBy");
  1687. migrationBuilder.CreateIndex(
  1688. name: "IX_TISP_Spot_C_CreateBy",
  1689. table: "TISP_Spot",
  1690. column: "C_CreateBy");
  1691. migrationBuilder.CreateIndex(
  1692. name: "IX_TISP_Spot_C_LastUpdatedBy",
  1693. table: "TISP_Spot",
  1694. column: "C_LastUpdatedBy");
  1695. migrationBuilder.CreateIndex(
  1696. name: "IX_TISP_SpotContent_C_ContentCode_C_SpotCode",
  1697. table: "TISP_SpotContent",
  1698. columns: new[] { "C_ContentCode", "C_SpotCode" },
  1699. unique: true);
  1700. migrationBuilder.CreateIndex(
  1701. name: "IX_TISP_SpotContent_C_CreateBy",
  1702. table: "TISP_SpotContent",
  1703. column: "C_CreateBy");
  1704. migrationBuilder.CreateIndex(
  1705. name: "IX_TISP_SpotRegion_C_CreateBy",
  1706. table: "TISP_SpotRegion",
  1707. column: "C_CreateBy");
  1708. migrationBuilder.CreateIndex(
  1709. name: "IX_TISP_SpotRegion_C_LastUpdatedBy",
  1710. table: "TISP_SpotRegion",
  1711. column: "C_LastUpdatedBy");
  1712. migrationBuilder.CreateIndex(
  1713. name: "IX_TISP_SpotRegion_C_RegionCode",
  1714. table: "TISP_SpotRegion",
  1715. column: "C_RegionCode");
  1716. migrationBuilder.CreateIndex(
  1717. name: "IX_TISP_SpotRegion_C_SpotCode",
  1718. table: "TISP_SpotRegion",
  1719. column: "C_SpotCode");
  1720. migrationBuilder.CreateIndex(
  1721. name: "IX_TISP_SpotRoute_C_CreateBy",
  1722. table: "TISP_SpotRoute",
  1723. column: "C_CreateBy");
  1724. migrationBuilder.CreateIndex(
  1725. name: "IX_TISP_SpotRoute_C_LastUpdatedBy",
  1726. table: "TISP_SpotRoute",
  1727. column: "C_LastUpdatedBy");
  1728. migrationBuilder.CreateIndex(
  1729. name: "IX_TISP_SpotRoute_C_RouteCode",
  1730. table: "TISP_SpotRoute",
  1731. column: "C_RouteCode");
  1732. migrationBuilder.CreateIndex(
  1733. name: "IX_TISP_SpotRoute_C_SpotCode",
  1734. table: "TISP_SpotRoute",
  1735. column: "C_SpotCode");
  1736. migrationBuilder.CreateIndex(
  1737. name: "IX_TISP_SpotUser_C_CreateBy",
  1738. table: "TISP_SpotUser",
  1739. column: "C_CreateBy");
  1740. migrationBuilder.CreateIndex(
  1741. name: "IX_TISP_SpotUser_C_SpotCode",
  1742. table: "TISP_SpotUser",
  1743. column: "C_SpotCode");
  1744. migrationBuilder.CreateIndex(
  1745. name: "IX_TISP_SpotUser_C_UserCode_C_SpotCode",
  1746. table: "TISP_SpotUser",
  1747. columns: new[] { "C_UserCode", "C_SpotCode" },
  1748. unique: true);
  1749. migrationBuilder.CreateIndex(
  1750. name: "IX_TPNT_Area_C_CreateBy",
  1751. table: "TPNT_Area",
  1752. column: "C_CreateBy");
  1753. migrationBuilder.CreateIndex(
  1754. name: "IX_TPNT_Area_C_LastUpdatedBy",
  1755. table: "TPNT_Area",
  1756. column: "C_LastUpdatedBy");
  1757. migrationBuilder.CreateIndex(
  1758. name: "IX_TPNT_Area_C_StoreCode",
  1759. table: "TPNT_Area",
  1760. column: "C_StoreCode");
  1761. migrationBuilder.CreateIndex(
  1762. name: "IX_TPNT_Store_C_AreaCode",
  1763. table: "TPNT_Store",
  1764. column: "C_AreaCode");
  1765. migrationBuilder.CreateIndex(
  1766. name: "IX_TPNT_Store_C_Code",
  1767. table: "TPNT_Store",
  1768. column: "C_Code",
  1769. unique: true);
  1770. migrationBuilder.CreateIndex(
  1771. name: "IX_TPNT_Store_C_CreateBy",
  1772. table: "TPNT_Store",
  1773. column: "C_CreateBy");
  1774. migrationBuilder.CreateIndex(
  1775. name: "IX_TPNT_Store_C_LastUpdatedBy",
  1776. table: "TPNT_Store",
  1777. column: "C_LastUpdatedBy");
  1778. migrationBuilder.CreateIndex(
  1779. name: "IX_TPNT_Store_C_TypeCode",
  1780. table: "TPNT_Store",
  1781. column: "C_TypeCode");
  1782. migrationBuilder.CreateIndex(
  1783. name: "IX_TPNT_Store_LicenseC_ID",
  1784. table: "TPNT_Store",
  1785. column: "LicenseC_ID");
  1786. migrationBuilder.CreateIndex(
  1787. name: "IX_TPNT_Store_StoreOrgC_StoreCode_StoreOrgC_OrgCode",
  1788. table: "TPNT_Store",
  1789. columns: new[] { "StoreOrgC_StoreCode", "StoreOrgC_OrgCode" });
  1790. migrationBuilder.CreateIndex(
  1791. name: "IX_TPNT_StoreOrg_C_CreateBy",
  1792. table: "TPNT_StoreOrg",
  1793. column: "C_CreateBy");
  1794. migrationBuilder.CreateIndex(
  1795. name: "IX_TPRD_Log_C_CreateBy",
  1796. table: "TPRD_Log",
  1797. column: "C_CreateBy");
  1798. migrationBuilder.CreateIndex(
  1799. name: "IX_TPRD_Log_C_ProductCode",
  1800. table: "TPRD_Log",
  1801. column: "C_ProductCode");
  1802. migrationBuilder.CreateIndex(
  1803. name: "IX_TPRD_ProdSKU_C_CreateBy",
  1804. table: "TPRD_ProdSKU",
  1805. column: "C_CreateBy");
  1806. migrationBuilder.CreateIndex(
  1807. name: "IX_TPRD_ProdSKU_C_LastUpdatedBy",
  1808. table: "TPRD_ProdSKU",
  1809. column: "C_LastUpdatedBy");
  1810. migrationBuilder.CreateIndex(
  1811. name: "IX_TPRD_ProdSKU_C_TypeCode",
  1812. table: "TPRD_ProdSKU",
  1813. column: "C_TypeCode");
  1814. migrationBuilder.CreateIndex(
  1815. name: "IX_TPRD_Product_C_CreateBy",
  1816. table: "TPRD_Product",
  1817. column: "C_CreateBy");
  1818. migrationBuilder.CreateIndex(
  1819. name: "IX_TPRD_Product_C_DeviceCode",
  1820. table: "TPRD_Product",
  1821. column: "C_DeviceCode");
  1822. migrationBuilder.CreateIndex(
  1823. name: "IX_TPRD_Product_C_LastUpdatedBy",
  1824. table: "TPRD_Product",
  1825. column: "C_LastUpdatedBy");
  1826. migrationBuilder.CreateIndex(
  1827. name: "IX_TPRD_Product_C_SKUCode",
  1828. table: "TPRD_Product",
  1829. column: "C_SKUCode");
  1830. migrationBuilder.CreateIndex(
  1831. name: "IX_TPRD_Type_C_CreateBy",
  1832. table: "TPRD_Type",
  1833. column: "C_CreateBy");
  1834. migrationBuilder.CreateIndex(
  1835. name: "IX_TPRD_Type_C_LastUpdatedBy",
  1836. table: "TPRD_Type",
  1837. column: "C_LastUpdatedBy");
  1838. migrationBuilder.CreateIndex(
  1839. name: "IX_TSEC_Record_C_CreateBy",
  1840. table: "TSEC_Record",
  1841. column: "C_CreateBy");
  1842. migrationBuilder.CreateIndex(
  1843. name: "IX_TSEC_Record_C_LastUpdatedBy",
  1844. table: "TSEC_Record",
  1845. column: "C_LastUpdatedBy");
  1846. migrationBuilder.CreateIndex(
  1847. name: "IX_TSEC_RecordItem_C_CreateBy",
  1848. table: "TSEC_RecordItem",
  1849. column: "C_CreateBy");
  1850. migrationBuilder.CreateIndex(
  1851. name: "IX_TSEC_RecordItem_C_LastUpdatedBy",
  1852. table: "TSEC_RecordItem",
  1853. column: "C_LastUpdatedBy");
  1854. migrationBuilder.CreateIndex(
  1855. name: "IX_TSYS_License_C_Code",
  1856. table: "TSYS_License",
  1857. column: "C_Code",
  1858. unique: true);
  1859. migrationBuilder.CreateIndex(
  1860. name: "IX_TSYS_License_C_TypeCode",
  1861. table: "TSYS_License",
  1862. column: "C_TypeCode");
  1863. migrationBuilder.CreateIndex(
  1864. name: "IX_TSYS_License_UsersCreateByC_UserID",
  1865. table: "TSYS_License",
  1866. column: "UsersCreateByC_UserID");
  1867. migrationBuilder.CreateIndex(
  1868. name: "IX_TSYS_LicenseType_C_CreateBy",
  1869. table: "TSYS_LicenseType",
  1870. column: "C_CreateBy");
  1871. migrationBuilder.CreateIndex(
  1872. name: "IX_TSYS_LicenseType_C_LastUpdatedBy",
  1873. table: "TSYS_LicenseType",
  1874. column: "C_LastUpdatedBy");
  1875. migrationBuilder.CreateIndex(
  1876. name: "IX_TSYS_LicenseTypePriv_C_CreateBy",
  1877. table: "TSYS_LicenseTypePriv",
  1878. column: "C_CreateBy");
  1879. migrationBuilder.CreateIndex(
  1880. name: "IX_TSYS_LicenseTypePriv_C_PrivilegeCode",
  1881. table: "TSYS_LicenseTypePriv",
  1882. column: "C_PrivilegeCode");
  1883. migrationBuilder.CreateIndex(
  1884. name: "IX_TSYS_Message_C_CreateBy",
  1885. table: "TSYS_Message",
  1886. column: "C_CreateBy");
  1887. migrationBuilder.CreateIndex(
  1888. name: "IX_TSYS_Message_C_LastUpdatedBy",
  1889. table: "TSYS_Message",
  1890. column: "C_LastUpdatedBy");
  1891. migrationBuilder.CreateIndex(
  1892. name: "IX_TSYS_Message_C_UserID",
  1893. table: "TSYS_Message",
  1894. column: "C_UserID");
  1895. migrationBuilder.CreateIndex(
  1896. name: "IX_TSYS_Org_StoreOrgC_StoreCode_StoreOrgC_OrgCode",
  1897. table: "TSYS_Org",
  1898. columns: new[] { "StoreOrgC_StoreCode", "StoreOrgC_OrgCode" });
  1899. migrationBuilder.CreateIndex(
  1900. name: "IX_TSYS_Priv_C_ParentCode",
  1901. table: "TSYS_Priv",
  1902. column: "C_ParentCode");
  1903. migrationBuilder.CreateIndex(
  1904. name: "IX_TSYS_Role_C_CreateBy",
  1905. table: "TSYS_Role",
  1906. column: "C_CreateBy");
  1907. migrationBuilder.CreateIndex(
  1908. name: "IX_TSYS_Role_C_LastUpdatedBy",
  1909. table: "TSYS_Role",
  1910. column: "C_LastUpdatedBy");
  1911. migrationBuilder.CreateIndex(
  1912. name: "IX_TSYS_RolePriv_C_CreateBy",
  1913. table: "TSYS_RolePriv",
  1914. column: "C_CreateBy");
  1915. migrationBuilder.CreateIndex(
  1916. name: "IX_TSYS_RolePriv_C_PrivilegeCode",
  1917. table: "TSYS_RolePriv",
  1918. column: "C_PrivilegeCode");
  1919. migrationBuilder.CreateIndex(
  1920. name: "IX_TSYS_User_C_CreateBy",
  1921. table: "TSYS_User",
  1922. column: "C_CreateBy");
  1923. migrationBuilder.CreateIndex(
  1924. name: "IX_TSYS_User_C_IDNum",
  1925. table: "TSYS_User",
  1926. column: "C_IDNum",
  1927. unique: true);
  1928. migrationBuilder.CreateIndex(
  1929. name: "IX_TSYS_User_C_LastUpdatedBy",
  1930. table: "TSYS_User",
  1931. column: "C_LastUpdatedBy");
  1932. migrationBuilder.CreateIndex(
  1933. name: "IX_TSYS_User_C_Mobile",
  1934. table: "TSYS_User",
  1935. column: "C_Mobile",
  1936. unique: true);
  1937. migrationBuilder.CreateIndex(
  1938. name: "IX_TSYS_UserRole_C_CreateBy",
  1939. table: "TSYS_UserRole",
  1940. column: "C_CreateBy");
  1941. migrationBuilder.CreateIndex(
  1942. name: "IX_TSYS_UserRole_C_RoleCode",
  1943. table: "TSYS_UserRole",
  1944. column: "C_RoleCode");
  1945. migrationBuilder.CreateIndex(
  1946. name: "IX_TSYS_Version_C_CreateBy",
  1947. table: "TSYS_Version",
  1948. column: "C_CreateBy");
  1949. migrationBuilder.CreateIndex(
  1950. name: "IX_TSYS_Version_C_LastUpdatedBy",
  1951. table: "TSYS_Version",
  1952. column: "C_LastUpdatedBy");
  1953. migrationBuilder.AddForeignKey(
  1954. name: "FK_TPRD_Product_TDEV_Device_C_DeviceCode",
  1955. table: "TPRD_Product",
  1956. column: "C_DeviceCode",
  1957. principalTable: "TDEV_Device",
  1958. principalColumn: "C_Code",
  1959. onDelete: ReferentialAction.Restrict);
  1960. }
  1961. protected override void Down(MigrationBuilder migrationBuilder)
  1962. {
  1963. migrationBuilder.DropForeignKey(
  1964. name: "FK_TDEV_Device_TSYS_User_C_CreateBy",
  1965. table: "TDEV_Device");
  1966. migrationBuilder.DropForeignKey(
  1967. name: "FK_TDEV_Device_TSYS_User_C_LastUpdatedBy",
  1968. table: "TDEV_Device");
  1969. migrationBuilder.DropForeignKey(
  1970. name: "FK_TPRD_ProdSKU_TSYS_User_C_CreateBy",
  1971. table: "TPRD_ProdSKU");
  1972. migrationBuilder.DropForeignKey(
  1973. name: "FK_TPRD_ProdSKU_TSYS_User_C_LastUpdatedBy",
  1974. table: "TPRD_ProdSKU");
  1975. migrationBuilder.DropForeignKey(
  1976. name: "FK_TPRD_Product_TSYS_User_C_CreateBy",
  1977. table: "TPRD_Product");
  1978. migrationBuilder.DropForeignKey(
  1979. name: "FK_TPRD_Product_TSYS_User_C_LastUpdatedBy",
  1980. table: "TPRD_Product");
  1981. migrationBuilder.DropForeignKey(
  1982. name: "FK_TPRD_Type_TSYS_User_C_CreateBy",
  1983. table: "TPRD_Type");
  1984. migrationBuilder.DropForeignKey(
  1985. name: "FK_TPRD_Type_TSYS_User_C_LastUpdatedBy",
  1986. table: "TPRD_Type");
  1987. migrationBuilder.DropForeignKey(
  1988. name: "FK_TDEV_Device_TPRD_Product_C_ProductCode",
  1989. table: "TDEV_Device");
  1990. migrationBuilder.DropTable(
  1991. name: "Report");
  1992. migrationBuilder.DropTable(
  1993. name: "TaskInfoDto");
  1994. migrationBuilder.DropTable(
  1995. name: "TBDM_CodeDetail");
  1996. migrationBuilder.DropTable(
  1997. name: "TBDM_CodeMain");
  1998. migrationBuilder.DropTable(
  1999. name: "TDEV_DevAlert");
  2000. migrationBuilder.DropTable(
  2001. name: "TDEV_DevAlertConfig");
  2002. migrationBuilder.DropTable(
  2003. name: "TDEV_DevData");
  2004. migrationBuilder.DropTable(
  2005. name: "TDEV_DevDataConfig");
  2006. migrationBuilder.DropTable(
  2007. name: "TISP_ContentGroupItem");
  2008. migrationBuilder.DropTable(
  2009. name: "TISP_RecordAlarm");
  2010. migrationBuilder.DropTable(
  2011. name: "TISP_RecordImage");
  2012. migrationBuilder.DropTable(
  2013. name: "TISP_SpotContent");
  2014. migrationBuilder.DropTable(
  2015. name: "TISP_SpotRegion");
  2016. migrationBuilder.DropTable(
  2017. name: "TISP_SpotRoute");
  2018. migrationBuilder.DropTable(
  2019. name: "TISP_SpotUser");
  2020. migrationBuilder.DropTable(
  2021. name: "TPNT_Area");
  2022. migrationBuilder.DropTable(
  2023. name: "TPRD_Log");
  2024. migrationBuilder.DropTable(
  2025. name: "TSEC_Record");
  2026. migrationBuilder.DropTable(
  2027. name: "TSEC_RecordImage");
  2028. migrationBuilder.DropTable(
  2029. name: "TSEC_RecordItem");
  2030. migrationBuilder.DropTable(
  2031. name: "TSYS_LicenseTypePriv");
  2032. migrationBuilder.DropTable(
  2033. name: "TSYS_Message");
  2034. migrationBuilder.DropTable(
  2035. name: "TSYS_Org");
  2036. migrationBuilder.DropTable(
  2037. name: "TSYS_Organize");
  2038. migrationBuilder.DropTable(
  2039. name: "TSYS_Post");
  2040. migrationBuilder.DropTable(
  2041. name: "TSYS_RolePriv");
  2042. migrationBuilder.DropTable(
  2043. name: "TSYS_UserPost");
  2044. migrationBuilder.DropTable(
  2045. name: "TSYS_UserRole");
  2046. migrationBuilder.DropTable(
  2047. name: "TSYS_Version");
  2048. migrationBuilder.DropTable(
  2049. name: "TasksQz");
  2050. migrationBuilder.DropTable(
  2051. name: "TISP_ContentGroup");
  2052. migrationBuilder.DropTable(
  2053. name: "TISP_RecordItem");
  2054. migrationBuilder.DropTable(
  2055. name: "TISP_Region");
  2056. migrationBuilder.DropTable(
  2057. name: "TISP_Route");
  2058. migrationBuilder.DropTable(
  2059. name: "TPNT_Store");
  2060. migrationBuilder.DropTable(
  2061. name: "TSYS_Priv");
  2062. migrationBuilder.DropTable(
  2063. name: "TSYS_Role");
  2064. migrationBuilder.DropTable(
  2065. name: "TISP_Content");
  2066. migrationBuilder.DropTable(
  2067. name: "TISP_Record");
  2068. migrationBuilder.DropTable(
  2069. name: "TBDM_Area");
  2070. migrationBuilder.DropTable(
  2071. name: "TPNT_StoreOrg");
  2072. migrationBuilder.DropTable(
  2073. name: "TPNT_Type");
  2074. migrationBuilder.DropTable(
  2075. name: "TSYS_License");
  2076. migrationBuilder.DropTable(
  2077. name: "TISP_Spot");
  2078. migrationBuilder.DropTable(
  2079. name: "TBDM_City");
  2080. migrationBuilder.DropTable(
  2081. name: "TSYS_LicenseType");
  2082. migrationBuilder.DropTable(
  2083. name: "TBDM_Prov");
  2084. migrationBuilder.DropTable(
  2085. name: "TSYS_User");
  2086. migrationBuilder.DropTable(
  2087. name: "TPRD_Product");
  2088. migrationBuilder.DropTable(
  2089. name: "TDEV_Device");
  2090. migrationBuilder.DropTable(
  2091. name: "TPRD_ProdSKU");
  2092. migrationBuilder.DropTable(
  2093. name: "TPRD_Type");
  2094. }
  2095. }
  2096. }