sqlserver_ry_job.sql 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825
  1. /*
  2. SnailJob Database Transfer Tool
  3. Source Server Type : MySQL
  4. Target Server Type : Microsoft SQL Server
  5. Date: 2025-04-26 10:03:23
  6. */
  7. -- sj_namespace
  8. CREATE TABLE sj_namespace
  9. (
  10. id bigint NOT NULL PRIMARY KEY IDENTITY,
  11. name nvarchar(64) NOT NULL,
  12. unique_id nvarchar(64) NOT NULL,
  13. description nvarchar(256) NOT NULL DEFAULT '',
  14. deleted tinyint NOT NULL DEFAULT 0,
  15. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  16. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  17. )
  18. GO
  19. CREATE INDEX idx_sj_namespace_01 ON sj_namespace (name)
  20. GO
  21. EXEC sp_addextendedproperty
  22. 'MS_Description', N'主键',
  23. 'SCHEMA', N'dbo',
  24. 'TABLE', N'sj_namespace',
  25. 'COLUMN', N'id'
  26. GO
  27. EXEC sp_addextendedproperty
  28. 'MS_Description', N'名称',
  29. 'SCHEMA', N'dbo',
  30. 'TABLE', N'sj_namespace',
  31. 'COLUMN', N'name'
  32. GO
  33. EXEC sp_addextendedproperty
  34. 'MS_Description', N'唯一id',
  35. 'SCHEMA', N'dbo',
  36. 'TABLE', N'sj_namespace',
  37. 'COLUMN', N'unique_id'
  38. GO
  39. EXEC sp_addextendedproperty
  40. 'MS_Description', N'描述',
  41. 'SCHEMA', N'dbo',
  42. 'TABLE', N'sj_namespace',
  43. 'COLUMN', N'description'
  44. GO
  45. EXEC sp_addextendedproperty
  46. 'MS_Description', N'逻辑删除 1、删除',
  47. 'SCHEMA', N'dbo',
  48. 'TABLE', N'sj_namespace',
  49. 'COLUMN', N'deleted'
  50. GO
  51. EXEC sp_addextendedproperty
  52. 'MS_Description', N'创建时间',
  53. 'SCHEMA', N'dbo',
  54. 'TABLE', N'sj_namespace',
  55. 'COLUMN', N'create_dt'
  56. GO
  57. EXEC sp_addextendedproperty
  58. 'MS_Description', N'修改时间',
  59. 'SCHEMA', N'dbo',
  60. 'TABLE', N'sj_namespace',
  61. 'COLUMN', N'update_dt'
  62. GO
  63. EXEC sp_addextendedproperty
  64. 'MS_Description', N'命名空间',
  65. 'SCHEMA', N'dbo',
  66. 'TABLE', N'sj_namespace'
  67. GO
  68. INSERT INTO sj_namespace(name, unique_id, description, deleted, create_dt, update_dt) VALUES (N'Development', N'dev', N'', 0, getdate(), getdate())
  69. GO
  70. INSERT INTO sj_namespace(name, unique_id, description, deleted, create_dt, update_dt) VALUES (N'Production', N'prod', N'', 0, getdate(), getdate())
  71. GO
  72. -- sj_group_config
  73. CREATE TABLE sj_group_config
  74. (
  75. id bigint NOT NULL PRIMARY KEY IDENTITY,
  76. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  77. group_name nvarchar(64) NOT NULL DEFAULT '',
  78. description nvarchar(256) NOT NULL DEFAULT '',
  79. token nvarchar(64) NOT NULL DEFAULT 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT',
  80. group_status tinyint NOT NULL DEFAULT 0,
  81. version int NOT NULL,
  82. group_partition int NOT NULL,
  83. id_generator_mode tinyint NOT NULL DEFAULT 1,
  84. init_scene tinyint NOT NULL DEFAULT 0,
  85. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  86. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  87. )
  88. GO
  89. CREATE UNIQUE INDEX uk_sj_group_config_01 ON sj_group_config (namespace_id, group_name)
  90. GO
  91. EXEC sp_addextendedproperty
  92. 'MS_Description', N'主键',
  93. 'SCHEMA', N'dbo',
  94. 'TABLE', N'sj_group_config',
  95. 'COLUMN', N'id'
  96. GO
  97. EXEC sp_addextendedproperty
  98. 'MS_Description', N'命名空间id',
  99. 'SCHEMA', N'dbo',
  100. 'TABLE', N'sj_group_config',
  101. 'COLUMN', N'namespace_id'
  102. GO
  103. EXEC sp_addextendedproperty
  104. 'MS_Description', N'组名称',
  105. 'SCHEMA', N'dbo',
  106. 'TABLE', N'sj_group_config',
  107. 'COLUMN', N'group_name'
  108. GO
  109. EXEC sp_addextendedproperty
  110. 'MS_Description', N'组描述',
  111. 'SCHEMA', N'dbo',
  112. 'TABLE', N'sj_group_config',
  113. 'COLUMN', N'description'
  114. GO
  115. EXEC sp_addextendedproperty
  116. 'MS_Description', N'token',
  117. 'SCHEMA', N'dbo',
  118. 'TABLE', N'sj_group_config',
  119. 'COLUMN', N'token'
  120. GO
  121. EXEC sp_addextendedproperty
  122. 'MS_Description', N'组状态 0、未启用 1、启用',
  123. 'SCHEMA', N'dbo',
  124. 'TABLE', N'sj_group_config',
  125. 'COLUMN', N'group_status'
  126. GO
  127. EXEC sp_addextendedproperty
  128. 'MS_Description', N'版本号',
  129. 'SCHEMA', N'dbo',
  130. 'TABLE', N'sj_group_config',
  131. 'COLUMN', N'version'
  132. GO
  133. EXEC sp_addextendedproperty
  134. 'MS_Description', N'分区',
  135. 'SCHEMA', N'dbo',
  136. 'TABLE', N'sj_group_config',
  137. 'COLUMN', N'group_partition'
  138. GO
  139. EXEC sp_addextendedproperty
  140. 'MS_Description', N'唯一id生成模式 默认号段模式',
  141. 'SCHEMA', N'dbo',
  142. 'TABLE', N'sj_group_config',
  143. 'COLUMN', N'id_generator_mode'
  144. GO
  145. EXEC sp_addextendedproperty
  146. 'MS_Description', N'是否初始化场景 0:否 1:是',
  147. 'SCHEMA', N'dbo',
  148. 'TABLE', N'sj_group_config',
  149. 'COLUMN', N'init_scene'
  150. GO
  151. EXEC sp_addextendedproperty
  152. 'MS_Description', N'创建时间',
  153. 'SCHEMA', N'dbo',
  154. 'TABLE', N'sj_group_config',
  155. 'COLUMN', N'create_dt'
  156. GO
  157. EXEC sp_addextendedproperty
  158. 'MS_Description', N'修改时间',
  159. 'SCHEMA', N'dbo',
  160. 'TABLE', N'sj_group_config',
  161. 'COLUMN', N'update_dt'
  162. GO
  163. EXEC sp_addextendedproperty
  164. 'MS_Description', N'组配置',
  165. 'SCHEMA', N'dbo',
  166. 'TABLE', N'sj_group_config'
  167. GO
  168. INSERT INTO sj_group_config(namespace_id, group_name, description, token, group_status, version, group_partition, id_generator_mode, init_scene, create_dt, update_dt) VALUES (N'dev', N'ruoyi_group', N'', N'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', N'1', N'1', N'0', N'1', N'1', getdate(), getdate())
  169. GO
  170. INSERT INTO sj_group_config(namespace_id, group_name, description, token, group_status, version, group_partition, id_generator_mode, init_scene, create_dt, update_dt) VALUES (N'prod', N'ruoyi_group', N'', N'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', N'1', N'1', N'0', N'1', N'1', getdate(), getdate())
  171. GO
  172. -- sj_notify_config
  173. CREATE TABLE sj_notify_config
  174. (
  175. id bigint NOT NULL PRIMARY KEY IDENTITY,
  176. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  177. group_name nvarchar(64) NOT NULL,
  178. notify_name nvarchar(64) NOT NULL DEFAULT '',
  179. system_task_type tinyint NOT NULL DEFAULT 3,
  180. notify_status tinyint NOT NULL DEFAULT 0,
  181. recipient_ids nvarchar(128) NOT NULL,
  182. notify_threshold int NOT NULL DEFAULT 0,
  183. notify_scene tinyint NOT NULL DEFAULT 0,
  184. rate_limiter_status tinyint NOT NULL DEFAULT 0,
  185. rate_limiter_threshold int NOT NULL DEFAULT 0,
  186. description nvarchar(256) NOT NULL DEFAULT '',
  187. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  188. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  189. )
  190. GO
  191. CREATE INDEX idx_sj_notify_config_01 ON sj_notify_config (namespace_id, group_name)
  192. GO
  193. EXEC sp_addextendedproperty
  194. 'MS_Description', N'主键',
  195. 'SCHEMA', N'dbo',
  196. 'TABLE', N'sj_notify_config',
  197. 'COLUMN', N'id'
  198. GO
  199. EXEC sp_addextendedproperty
  200. 'MS_Description', N'命名空间id',
  201. 'SCHEMA', N'dbo',
  202. 'TABLE', N'sj_notify_config',
  203. 'COLUMN', N'namespace_id'
  204. GO
  205. EXEC sp_addextendedproperty
  206. 'MS_Description', N'组名称',
  207. 'SCHEMA', N'dbo',
  208. 'TABLE', N'sj_notify_config',
  209. 'COLUMN', N'group_name'
  210. GO
  211. EXEC sp_addextendedproperty
  212. 'MS_Description', N'通知名称',
  213. 'SCHEMA', N'dbo',
  214. 'TABLE', N'sj_notify_config',
  215. 'COLUMN', N'notify_name'
  216. GO
  217. EXEC sp_addextendedproperty
  218. 'MS_Description', N'任务类型 1. 重试任务 2. 重试回调 3、JOB任务 4、WORKFLOW任务',
  219. 'SCHEMA', N'dbo',
  220. 'TABLE', N'sj_notify_config',
  221. 'COLUMN', N'system_task_type'
  222. GO
  223. EXEC sp_addextendedproperty
  224. 'MS_Description', N'通知状态 0、未启用 1、启用',
  225. 'SCHEMA', N'dbo',
  226. 'TABLE', N'sj_notify_config',
  227. 'COLUMN', N'notify_status'
  228. GO
  229. EXEC sp_addextendedproperty
  230. 'MS_Description', N'接收人id列表',
  231. 'SCHEMA', N'dbo',
  232. 'TABLE', N'sj_notify_config',
  233. 'COLUMN', N'recipient_ids'
  234. GO
  235. EXEC sp_addextendedproperty
  236. 'MS_Description', N'通知阈值',
  237. 'SCHEMA', N'dbo',
  238. 'TABLE', N'sj_notify_config',
  239. 'COLUMN', N'notify_threshold'
  240. GO
  241. EXEC sp_addextendedproperty
  242. 'MS_Description', N'通知场景',
  243. 'SCHEMA', N'dbo',
  244. 'TABLE', N'sj_notify_config',
  245. 'COLUMN', N'notify_scene'
  246. GO
  247. EXEC sp_addextendedproperty
  248. 'MS_Description', N'限流状态 0、未启用 1、启用',
  249. 'SCHEMA', N'dbo',
  250. 'TABLE', N'sj_notify_config',
  251. 'COLUMN', N'rate_limiter_status'
  252. GO
  253. EXEC sp_addextendedproperty
  254. 'MS_Description', N'每秒限流阈值',
  255. 'SCHEMA', N'dbo',
  256. 'TABLE', N'sj_notify_config',
  257. 'COLUMN', N'rate_limiter_threshold'
  258. GO
  259. EXEC sp_addextendedproperty
  260. 'MS_Description', N'描述',
  261. 'SCHEMA', N'dbo',
  262. 'TABLE', N'sj_notify_config',
  263. 'COLUMN', N'description'
  264. GO
  265. EXEC sp_addextendedproperty
  266. 'MS_Description', N'创建时间',
  267. 'SCHEMA', N'dbo',
  268. 'TABLE', N'sj_notify_config',
  269. 'COLUMN', N'create_dt'
  270. GO
  271. EXEC sp_addextendedproperty
  272. 'MS_Description', N'修改时间',
  273. 'SCHEMA', N'dbo',
  274. 'TABLE', N'sj_notify_config',
  275. 'COLUMN', N'update_dt'
  276. GO
  277. EXEC sp_addextendedproperty
  278. 'MS_Description', N'通知配置',
  279. 'SCHEMA', N'dbo',
  280. 'TABLE', N'sj_notify_config'
  281. GO
  282. -- sj_notify_recipient
  283. CREATE TABLE sj_notify_recipient
  284. (
  285. id bigint NOT NULL PRIMARY KEY IDENTITY,
  286. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  287. recipient_name nvarchar(64) NOT NULL,
  288. notify_type tinyint NOT NULL DEFAULT 0,
  289. notify_attribute nvarchar(512) NOT NULL,
  290. description nvarchar(256) NOT NULL DEFAULT '',
  291. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  292. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  293. )
  294. GO
  295. CREATE INDEX idx_sj_notify_recipient_01 ON sj_notify_recipient (namespace_id)
  296. GO
  297. EXEC sp_addextendedproperty
  298. 'MS_Description', N'主键',
  299. 'SCHEMA', N'dbo',
  300. 'TABLE', N'sj_notify_recipient',
  301. 'COLUMN', N'id'
  302. GO
  303. EXEC sp_addextendedproperty
  304. 'MS_Description', N'命名空间id',
  305. 'SCHEMA', N'dbo',
  306. 'TABLE', N'sj_notify_recipient',
  307. 'COLUMN', N'namespace_id'
  308. GO
  309. EXEC sp_addextendedproperty
  310. 'MS_Description', N'接收人名称',
  311. 'SCHEMA', N'dbo',
  312. 'TABLE', N'sj_notify_recipient',
  313. 'COLUMN', N'recipient_name'
  314. GO
  315. EXEC sp_addextendedproperty
  316. 'MS_Description', N'通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书 5 webhook',
  317. 'SCHEMA', N'dbo',
  318. 'TABLE', N'sj_notify_recipient',
  319. 'COLUMN', N'notify_type'
  320. GO
  321. EXEC sp_addextendedproperty
  322. 'MS_Description', N'配置属性',
  323. 'SCHEMA', N'dbo',
  324. 'TABLE', N'sj_notify_recipient',
  325. 'COLUMN', N'notify_attribute'
  326. GO
  327. EXEC sp_addextendedproperty
  328. 'MS_Description', N'描述',
  329. 'SCHEMA', N'dbo',
  330. 'TABLE', N'sj_notify_recipient',
  331. 'COLUMN', N'description'
  332. GO
  333. EXEC sp_addextendedproperty
  334. 'MS_Description', N'创建时间',
  335. 'SCHEMA', N'dbo',
  336. 'TABLE', N'sj_notify_recipient',
  337. 'COLUMN', N'create_dt'
  338. GO
  339. EXEC sp_addextendedproperty
  340. 'MS_Description', N'修改时间',
  341. 'SCHEMA', N'dbo',
  342. 'TABLE', N'sj_notify_recipient',
  343. 'COLUMN', N'update_dt'
  344. GO
  345. EXEC sp_addextendedproperty
  346. 'MS_Description', N'告警通知接收人',
  347. 'SCHEMA', N'dbo',
  348. 'TABLE', N'sj_notify_recipient'
  349. GO
  350. -- sj_retry_dead_letter
  351. CREATE TABLE sj_retry_dead_letter
  352. (
  353. id bigint NOT NULL PRIMARY KEY IDENTITY,
  354. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  355. group_name nvarchar(64) NOT NULL,
  356. group_id bigint NOT NULL,
  357. scene_name nvarchar(64) NOT NULL,
  358. scene_id bigint NOT NULL,
  359. idempotent_id nvarchar(64) NOT NULL,
  360. biz_no nvarchar(64) NOT NULL DEFAULT '',
  361. executor_name nvarchar(512) NOT NULL DEFAULT '',
  362. args_str nvarchar(max) NOT NULL,
  363. ext_attrs nvarchar(max) NOT NULL,
  364. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  365. )
  366. GO
  367. CREATE INDEX idx_sj_retry_dead_letter_01 ON sj_retry_dead_letter (namespace_id, group_name, scene_name)
  368. GO
  369. CREATE INDEX idx_sj_retry_dead_letter_02 ON sj_retry_dead_letter (idempotent_id)
  370. GO
  371. CREATE INDEX idx_sj_retry_dead_letter_03 ON sj_retry_dead_letter (biz_no)
  372. GO
  373. CREATE INDEX idx_sj_retry_dead_letter_04 ON sj_retry_dead_letter (create_dt)
  374. GO
  375. EXEC sp_addextendedproperty
  376. 'MS_Description', N'主键',
  377. 'SCHEMA', N'dbo',
  378. 'TABLE', N'sj_retry_dead_letter',
  379. 'COLUMN', N'id'
  380. GO
  381. EXEC sp_addextendedproperty
  382. 'MS_Description', N'命名空间id',
  383. 'SCHEMA', N'dbo',
  384. 'TABLE', N'sj_retry_dead_letter',
  385. 'COLUMN', N'namespace_id'
  386. GO
  387. EXEC sp_addextendedproperty
  388. 'MS_Description', N'组名称',
  389. 'SCHEMA', N'dbo',
  390. 'TABLE', N'sj_retry_dead_letter',
  391. 'COLUMN', N'group_name'
  392. GO
  393. EXEC sp_addextendedproperty
  394. 'MS_Description', N'组Id',
  395. 'SCHEMA', N'dbo',
  396. 'TABLE', N'sj_retry_dead_letter',
  397. 'COLUMN', N'group_id'
  398. GO
  399. EXEC sp_addextendedproperty
  400. 'MS_Description', N'场景名称',
  401. 'SCHEMA', N'dbo',
  402. 'TABLE', N'sj_retry_dead_letter',
  403. 'COLUMN', N'scene_name'
  404. GO
  405. EXEC sp_addextendedproperty
  406. 'MS_Description', N'场景ID',
  407. 'SCHEMA', N'dbo',
  408. 'TABLE', N'sj_retry_dead_letter',
  409. 'COLUMN', N'scene_id'
  410. GO
  411. EXEC sp_addextendedproperty
  412. 'MS_Description', N'幂等id',
  413. 'SCHEMA', N'dbo',
  414. 'TABLE', N'sj_retry_dead_letter',
  415. 'COLUMN', N'idempotent_id'
  416. GO
  417. EXEC sp_addextendedproperty
  418. 'MS_Description', N'业务编号',
  419. 'SCHEMA', N'dbo',
  420. 'TABLE', N'sj_retry_dead_letter',
  421. 'COLUMN', N'biz_no'
  422. GO
  423. EXEC sp_addextendedproperty
  424. 'MS_Description', N'执行器名称',
  425. 'SCHEMA', N'dbo',
  426. 'TABLE', N'sj_retry_dead_letter',
  427. 'COLUMN', N'executor_name'
  428. GO
  429. EXEC sp_addextendedproperty
  430. 'MS_Description', N'执行方法参数',
  431. 'SCHEMA', N'dbo',
  432. 'TABLE', N'sj_retry_dead_letter',
  433. 'COLUMN', N'args_str'
  434. GO
  435. EXEC sp_addextendedproperty
  436. 'MS_Description', N'扩展字段',
  437. 'SCHEMA', N'dbo',
  438. 'TABLE', N'sj_retry_dead_letter',
  439. 'COLUMN', N'ext_attrs'
  440. GO
  441. EXEC sp_addextendedproperty
  442. 'MS_Description', N'创建时间',
  443. 'SCHEMA', N'dbo',
  444. 'TABLE', N'sj_retry_dead_letter',
  445. 'COLUMN', N'create_dt'
  446. GO
  447. EXEC sp_addextendedproperty
  448. 'MS_Description', N'死信队列表',
  449. 'SCHEMA', N'dbo',
  450. 'TABLE', N'sj_retry_dead_letter'
  451. GO
  452. -- sj_retry
  453. CREATE TABLE sj_retry
  454. (
  455. id bigint NOT NULL PRIMARY KEY IDENTITY,
  456. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  457. group_name nvarchar(64) NOT NULL,
  458. group_id bigint NOT NULL,
  459. scene_name nvarchar(64) NOT NULL,
  460. scene_id bigint NOT NULL,
  461. idempotent_id nvarchar(64) NOT NULL,
  462. biz_no nvarchar(64) NOT NULL DEFAULT '',
  463. executor_name nvarchar(512) NOT NULL DEFAULT '',
  464. args_str nvarchar(max) NOT NULL,
  465. ext_attrs nvarchar(max) NOT NULL,
  466. next_trigger_at bigint NOT NULL,
  467. retry_count int NOT NULL DEFAULT 0,
  468. retry_status tinyint NOT NULL DEFAULT 0,
  469. task_type tinyint NOT NULL DEFAULT 1,
  470. bucket_index int NOT NULL DEFAULT 0,
  471. parent_id bigint NOT NULL DEFAULT 0,
  472. deleted bigint NOT NULL DEFAULT 0,
  473. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  474. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  475. )
  476. GO
  477. CREATE UNIQUE INDEX uk_sj_retry_01 ON sj_retry (scene_id, task_type, idempotent_id, deleted)
  478. GO
  479. CREATE INDEX idx_sj_retry_01 ON sj_retry (biz_no)
  480. GO
  481. CREATE INDEX idx_sj_retry_02 ON sj_retry (retry_status, bucket_index)
  482. GO
  483. CREATE INDEX idx_sj_retry_03 ON sj_retry (parent_id)
  484. GO
  485. CREATE INDEX idx_sj_retry_04 ON sj_retry (create_dt)
  486. GO
  487. CREATE INDEX idx_sj_retry_05 ON sj_retry (idempotent_id)
  488. GO
  489. EXEC sp_addextendedproperty
  490. 'MS_Description', N'主键',
  491. 'SCHEMA', N'dbo',
  492. 'TABLE', N'sj_retry',
  493. 'COLUMN', N'id'
  494. GO
  495. EXEC sp_addextendedproperty
  496. 'MS_Description', N'命名空间id',
  497. 'SCHEMA', N'dbo',
  498. 'TABLE', N'sj_retry',
  499. 'COLUMN', N'namespace_id'
  500. GO
  501. EXEC sp_addextendedproperty
  502. 'MS_Description', N'组名称',
  503. 'SCHEMA', N'dbo',
  504. 'TABLE', N'sj_retry',
  505. 'COLUMN', N'group_name'
  506. GO
  507. EXEC sp_addextendedproperty
  508. 'MS_Description', N'组Id',
  509. 'SCHEMA', N'dbo',
  510. 'TABLE', N'sj_retry',
  511. 'COLUMN', N'group_id'
  512. GO
  513. EXEC sp_addextendedproperty
  514. 'MS_Description', N'场景名称',
  515. 'SCHEMA', N'dbo',
  516. 'TABLE', N'sj_retry',
  517. 'COLUMN', N'scene_name'
  518. GO
  519. EXEC sp_addextendedproperty
  520. 'MS_Description', N'场景ID',
  521. 'SCHEMA', N'dbo',
  522. 'TABLE', N'sj_retry',
  523. 'COLUMN', N'scene_id'
  524. GO
  525. EXEC sp_addextendedproperty
  526. 'MS_Description', N'幂等id',
  527. 'SCHEMA', N'dbo',
  528. 'TABLE', N'sj_retry',
  529. 'COLUMN', N'idempotent_id'
  530. GO
  531. EXEC sp_addextendedproperty
  532. 'MS_Description', N'业务编号',
  533. 'SCHEMA', N'dbo',
  534. 'TABLE', N'sj_retry',
  535. 'COLUMN', N'biz_no'
  536. GO
  537. EXEC sp_addextendedproperty
  538. 'MS_Description', N'执行器名称',
  539. 'SCHEMA', N'dbo',
  540. 'TABLE', N'sj_retry',
  541. 'COLUMN', N'executor_name'
  542. GO
  543. EXEC sp_addextendedproperty
  544. 'MS_Description', N'执行方法参数',
  545. 'SCHEMA', N'dbo',
  546. 'TABLE', N'sj_retry',
  547. 'COLUMN', N'args_str'
  548. GO
  549. EXEC sp_addextendedproperty
  550. 'MS_Description', N'扩展字段',
  551. 'SCHEMA', N'dbo',
  552. 'TABLE', N'sj_retry',
  553. 'COLUMN', N'ext_attrs'
  554. GO
  555. EXEC sp_addextendedproperty
  556. 'MS_Description', N'下次触发时间',
  557. 'SCHEMA', N'dbo',
  558. 'TABLE', N'sj_retry',
  559. 'COLUMN', N'next_trigger_at'
  560. GO
  561. EXEC sp_addextendedproperty
  562. 'MS_Description', N'重试次数',
  563. 'SCHEMA', N'dbo',
  564. 'TABLE', N'sj_retry',
  565. 'COLUMN', N'retry_count'
  566. GO
  567. EXEC sp_addextendedproperty
  568. 'MS_Description', N'重试状态 0、重试中 1、成功 2、最大重试次数',
  569. 'SCHEMA', N'dbo',
  570. 'TABLE', N'sj_retry',
  571. 'COLUMN', N'retry_status'
  572. GO
  573. EXEC sp_addextendedproperty
  574. 'MS_Description', N'任务类型 1、重试数据 2、回调数据',
  575. 'SCHEMA', N'dbo',
  576. 'TABLE', N'sj_retry',
  577. 'COLUMN', N'task_type'
  578. GO
  579. EXEC sp_addextendedproperty
  580. 'MS_Description', N'bucket',
  581. 'SCHEMA', N'dbo',
  582. 'TABLE', N'sj_retry',
  583. 'COLUMN', N'bucket_index'
  584. GO
  585. EXEC sp_addextendedproperty
  586. 'MS_Description', N'父节点id',
  587. 'SCHEMA', N'dbo',
  588. 'TABLE', N'sj_retry',
  589. 'COLUMN', N'parent_id'
  590. GO
  591. EXEC sp_addextendedproperty
  592. 'MS_Description', N'逻辑删除',
  593. 'SCHEMA', N'dbo',
  594. 'TABLE', N'sj_retry',
  595. 'COLUMN', N'deleted'
  596. GO
  597. EXEC sp_addextendedproperty
  598. 'MS_Description', N'创建时间',
  599. 'SCHEMA', N'dbo',
  600. 'TABLE', N'sj_retry',
  601. 'COLUMN', N'create_dt'
  602. GO
  603. EXEC sp_addextendedproperty
  604. 'MS_Description', N'修改时间',
  605. 'SCHEMA', N'dbo',
  606. 'TABLE', N'sj_retry',
  607. 'COLUMN', N'update_dt'
  608. GO
  609. EXEC sp_addextendedproperty
  610. 'MS_Description', N'重试信息表',
  611. 'SCHEMA', N'dbo',
  612. 'TABLE', N'sj_retry'
  613. GO
  614. -- sj_retry_task
  615. CREATE TABLE sj_retry_task
  616. (
  617. id bigint NOT NULL PRIMARY KEY IDENTITY,
  618. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  619. group_name nvarchar(64) NOT NULL,
  620. scene_name nvarchar(64) NOT NULL,
  621. retry_id bigint NOT NULL,
  622. ext_attrs nvarchar(max) NOT NULL,
  623. task_status tinyint NOT NULL DEFAULT 1,
  624. task_type tinyint NOT NULL DEFAULT 1,
  625. operation_reason tinyint NOT NULL DEFAULT 0,
  626. client_info nvarchar(128) NULL DEFAULT NULL,
  627. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  628. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  629. )
  630. GO
  631. CREATE INDEX idx_sj_retry_task_01 ON sj_retry_task (namespace_id, group_name, scene_name)
  632. GO
  633. CREATE INDEX idx_sj_retry_task_02 ON sj_retry_task (task_status)
  634. GO
  635. CREATE INDEX idx_sj_retry_task_03 ON sj_retry_task (create_dt)
  636. GO
  637. CREATE INDEX idx_sj_retry_task_04 ON sj_retry_task (retry_id)
  638. GO
  639. EXEC sp_addextendedproperty
  640. 'MS_Description', N'主键',
  641. 'SCHEMA', N'dbo',
  642. 'TABLE', N'sj_retry_task',
  643. 'COLUMN', N'id'
  644. GO
  645. EXEC sp_addextendedproperty
  646. 'MS_Description', N'命名空间id',
  647. 'SCHEMA', N'dbo',
  648. 'TABLE', N'sj_retry_task',
  649. 'COLUMN', N'namespace_id'
  650. GO
  651. EXEC sp_addextendedproperty
  652. 'MS_Description', N'组名称',
  653. 'SCHEMA', N'dbo',
  654. 'TABLE', N'sj_retry_task',
  655. 'COLUMN', N'group_name'
  656. GO
  657. EXEC sp_addextendedproperty
  658. 'MS_Description', N'场景名称',
  659. 'SCHEMA', N'dbo',
  660. 'TABLE', N'sj_retry_task',
  661. 'COLUMN', N'scene_name'
  662. GO
  663. EXEC sp_addextendedproperty
  664. 'MS_Description', N'重试信息Id',
  665. 'SCHEMA', N'dbo',
  666. 'TABLE', N'sj_retry_task',
  667. 'COLUMN', N'retry_id'
  668. GO
  669. EXEC sp_addextendedproperty
  670. 'MS_Description', N'扩展字段',
  671. 'SCHEMA', N'dbo',
  672. 'TABLE', N'sj_retry_task',
  673. 'COLUMN', N'ext_attrs'
  674. GO
  675. EXEC sp_addextendedproperty
  676. 'MS_Description', N'重试状态',
  677. 'SCHEMA', N'dbo',
  678. 'TABLE', N'sj_retry_task',
  679. 'COLUMN', N'task_status'
  680. GO
  681. EXEC sp_addextendedproperty
  682. 'MS_Description', N'任务类型 1、重试数据 2、回调数据',
  683. 'SCHEMA', N'dbo',
  684. 'TABLE', N'sj_retry_task',
  685. 'COLUMN', N'task_type'
  686. GO
  687. EXEC sp_addextendedproperty
  688. 'MS_Description', N'操作原因',
  689. 'SCHEMA', N'dbo',
  690. 'TABLE', N'sj_retry_task',
  691. 'COLUMN', N'operation_reason'
  692. GO
  693. EXEC sp_addextendedproperty
  694. 'MS_Description', N'客户端地址 clientId#ip:port',
  695. 'SCHEMA', N'dbo',
  696. 'TABLE', N'sj_retry_task',
  697. 'COLUMN', N'client_info'
  698. GO
  699. EXEC sp_addextendedproperty
  700. 'MS_Description', N'创建时间',
  701. 'SCHEMA', N'dbo',
  702. 'TABLE', N'sj_retry_task',
  703. 'COLUMN', N'create_dt'
  704. GO
  705. EXEC sp_addextendedproperty
  706. 'MS_Description', N'修改时间',
  707. 'SCHEMA', N'dbo',
  708. 'TABLE', N'sj_retry_task',
  709. 'COLUMN', N'update_dt'
  710. GO
  711. EXEC sp_addextendedproperty
  712. 'MS_Description', N'重试任务表',
  713. 'SCHEMA', N'dbo',
  714. 'TABLE', N'sj_retry_task'
  715. GO
  716. -- sj_retry_task_log_message
  717. CREATE TABLE sj_retry_task_log_message
  718. (
  719. id bigint NOT NULL PRIMARY KEY IDENTITY,
  720. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  721. group_name nvarchar(64) NOT NULL,
  722. retry_id bigint NOT NULL,
  723. retry_task_id bigint NOT NULL,
  724. message nvarchar(max) NOT NULL,
  725. log_num int NOT NULL DEFAULT 1,
  726. real_time bigint NOT NULL DEFAULT 0,
  727. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  728. )
  729. GO
  730. CREATE INDEX idx_sj_retry_task_log_message_01 ON sj_retry_task_log_message (namespace_id, group_name, retry_task_id)
  731. GO
  732. CREATE INDEX idx_sj_retry_task_log_message_02 ON sj_retry_task_log_message (create_dt)
  733. GO
  734. EXEC sp_addextendedproperty
  735. 'MS_Description', N'主键',
  736. 'SCHEMA', N'dbo',
  737. 'TABLE', N'sj_retry_task_log_message',
  738. 'COLUMN', N'id'
  739. GO
  740. EXEC sp_addextendedproperty
  741. 'MS_Description', N'命名空间id',
  742. 'SCHEMA', N'dbo',
  743. 'TABLE', N'sj_retry_task_log_message',
  744. 'COLUMN', N'namespace_id'
  745. GO
  746. EXEC sp_addextendedproperty
  747. 'MS_Description', N'组名称',
  748. 'SCHEMA', N'dbo',
  749. 'TABLE', N'sj_retry_task_log_message',
  750. 'COLUMN', N'group_name'
  751. GO
  752. EXEC sp_addextendedproperty
  753. 'MS_Description', N'重试信息Id',
  754. 'SCHEMA', N'dbo',
  755. 'TABLE', N'sj_retry_task_log_message',
  756. 'COLUMN', N'retry_id'
  757. GO
  758. EXEC sp_addextendedproperty
  759. 'MS_Description', N'重试任务Id',
  760. 'SCHEMA', N'dbo',
  761. 'TABLE', N'sj_retry_task_log_message',
  762. 'COLUMN', N'retry_task_id'
  763. GO
  764. EXEC sp_addextendedproperty
  765. 'MS_Description', N'异常信息',
  766. 'SCHEMA', N'dbo',
  767. 'TABLE', N'sj_retry_task_log_message',
  768. 'COLUMN', N'message'
  769. GO
  770. EXEC sp_addextendedproperty
  771. 'MS_Description', N'日志数量',
  772. 'SCHEMA', N'dbo',
  773. 'TABLE', N'sj_retry_task_log_message',
  774. 'COLUMN', N'log_num'
  775. GO
  776. EXEC sp_addextendedproperty
  777. 'MS_Description', N'上报时间',
  778. 'SCHEMA', N'dbo',
  779. 'TABLE', N'sj_retry_task_log_message',
  780. 'COLUMN', N'real_time'
  781. GO
  782. EXEC sp_addextendedproperty
  783. 'MS_Description', N'创建时间',
  784. 'SCHEMA', N'dbo',
  785. 'TABLE', N'sj_retry_task_log_message',
  786. 'COLUMN', N'create_dt'
  787. GO
  788. EXEC sp_addextendedproperty
  789. 'MS_Description', N'任务调度日志信息记录表',
  790. 'SCHEMA', N'dbo',
  791. 'TABLE', N'sj_retry_task_log_message'
  792. GO
  793. -- sj_retry_scene_config
  794. CREATE TABLE sj_retry_scene_config
  795. (
  796. id bigint NOT NULL PRIMARY KEY IDENTITY,
  797. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  798. scene_name nvarchar(64) NOT NULL,
  799. group_name nvarchar(64) NOT NULL,
  800. scene_status tinyint NOT NULL DEFAULT 0,
  801. max_retry_count int NOT NULL DEFAULT 5,
  802. back_off tinyint NOT NULL DEFAULT 1,
  803. trigger_interval nvarchar(16) NOT NULL DEFAULT '',
  804. notify_ids nvarchar(128) NOT NULL DEFAULT '',
  805. deadline_request bigint NOT NULL DEFAULT 60000,
  806. executor_timeout int NOT NULL DEFAULT 5,
  807. route_key tinyint NOT NULL DEFAULT 4,
  808. block_strategy tinyint NOT NULL DEFAULT 1,
  809. cb_status tinyint NOT NULL DEFAULT 0,
  810. cb_trigger_type tinyint NOT NULL DEFAULT 1,
  811. cb_max_count int NOT NULL DEFAULT 16,
  812. cb_trigger_interval nvarchar(16) NOT NULL DEFAULT '',
  813. description nvarchar(256) NOT NULL DEFAULT '',
  814. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  815. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  816. )
  817. GO
  818. CREATE UNIQUE INDEX uk_sj_retry_scene_config_01 ON sj_retry_scene_config (namespace_id, group_name, scene_name)
  819. GO
  820. EXEC sp_addextendedproperty
  821. 'MS_Description', N'主键',
  822. 'SCHEMA', N'dbo',
  823. 'TABLE', N'sj_retry_scene_config',
  824. 'COLUMN', N'id'
  825. GO
  826. EXEC sp_addextendedproperty
  827. 'MS_Description', N'命名空间id',
  828. 'SCHEMA', N'dbo',
  829. 'TABLE', N'sj_retry_scene_config',
  830. 'COLUMN', N'namespace_id'
  831. GO
  832. EXEC sp_addextendedproperty
  833. 'MS_Description', N'场景名称',
  834. 'SCHEMA', N'dbo',
  835. 'TABLE', N'sj_retry_scene_config',
  836. 'COLUMN', N'scene_name'
  837. GO
  838. EXEC sp_addextendedproperty
  839. 'MS_Description', N'组名称',
  840. 'SCHEMA', N'dbo',
  841. 'TABLE', N'sj_retry_scene_config',
  842. 'COLUMN', N'group_name'
  843. GO
  844. EXEC sp_addextendedproperty
  845. 'MS_Description', N'组状态 0、未启用 1、启用',
  846. 'SCHEMA', N'dbo',
  847. 'TABLE', N'sj_retry_scene_config',
  848. 'COLUMN', N'scene_status'
  849. GO
  850. EXEC sp_addextendedproperty
  851. 'MS_Description', N'最大重试次数',
  852. 'SCHEMA', N'dbo',
  853. 'TABLE', N'sj_retry_scene_config',
  854. 'COLUMN', N'max_retry_count'
  855. GO
  856. EXEC sp_addextendedproperty
  857. 'MS_Description', N'1、默认等级 2、固定间隔时间 3、CRON 表达式',
  858. 'SCHEMA', N'dbo',
  859. 'TABLE', N'sj_retry_scene_config',
  860. 'COLUMN', N'back_off'
  861. GO
  862. EXEC sp_addextendedproperty
  863. 'MS_Description', N'间隔时长',
  864. 'SCHEMA', N'dbo',
  865. 'TABLE', N'sj_retry_scene_config',
  866. 'COLUMN', N'trigger_interval'
  867. GO
  868. EXEC sp_addextendedproperty
  869. 'MS_Description', N'通知告警场景配置id列表',
  870. 'SCHEMA', N'dbo',
  871. 'TABLE', N'sj_retry_scene_config',
  872. 'COLUMN', N'notify_ids'
  873. GO
  874. EXEC sp_addextendedproperty
  875. 'MS_Description', N'Deadline Request 调用链超时 单位毫秒',
  876. 'SCHEMA', N'dbo',
  877. 'TABLE', N'sj_retry_scene_config',
  878. 'COLUMN', N'deadline_request'
  879. GO
  880. EXEC sp_addextendedproperty
  881. 'MS_Description', N'任务执行超时时间,单位秒',
  882. 'SCHEMA', N'dbo',
  883. 'TABLE', N'sj_retry_scene_config',
  884. 'COLUMN', N'executor_timeout'
  885. GO
  886. EXEC sp_addextendedproperty
  887. 'MS_Description', N'路由策略',
  888. 'SCHEMA', N'dbo',
  889. 'TABLE', N'sj_retry_scene_config',
  890. 'COLUMN', N'route_key'
  891. GO
  892. EXEC sp_addextendedproperty
  893. 'MS_Description', N'阻塞策略 1、丢弃 2、覆盖 3、并行',
  894. 'SCHEMA', N'dbo',
  895. 'TABLE', N'sj_retry_scene_config',
  896. 'COLUMN', N'block_strategy'
  897. GO
  898. EXEC sp_addextendedproperty
  899. 'MS_Description', N'回调状态 0、不开启 1、开启',
  900. 'SCHEMA', N'dbo',
  901. 'TABLE', N'sj_retry_scene_config',
  902. 'COLUMN', N'cb_status'
  903. GO
  904. EXEC sp_addextendedproperty
  905. 'MS_Description', N'1、默认等级 2、固定间隔时间 3、CRON 表达式',
  906. 'SCHEMA', N'dbo',
  907. 'TABLE', N'sj_retry_scene_config',
  908. 'COLUMN', N'cb_trigger_type'
  909. GO
  910. EXEC sp_addextendedproperty
  911. 'MS_Description', N'回调的最大执行次数',
  912. 'SCHEMA', N'dbo',
  913. 'TABLE', N'sj_retry_scene_config',
  914. 'COLUMN', N'cb_max_count'
  915. GO
  916. EXEC sp_addextendedproperty
  917. 'MS_Description', N'回调的最大执行次数',
  918. 'SCHEMA', N'dbo',
  919. 'TABLE', N'sj_retry_scene_config',
  920. 'COLUMN', N'cb_trigger_interval'
  921. GO
  922. EXEC sp_addextendedproperty
  923. 'MS_Description', N'描述',
  924. 'SCHEMA', N'dbo',
  925. 'TABLE', N'sj_retry_scene_config',
  926. 'COLUMN', N'description'
  927. GO
  928. EXEC sp_addextendedproperty
  929. 'MS_Description', N'创建时间',
  930. 'SCHEMA', N'dbo',
  931. 'TABLE', N'sj_retry_scene_config',
  932. 'COLUMN', N'create_dt'
  933. GO
  934. EXEC sp_addextendedproperty
  935. 'MS_Description', N'修改时间',
  936. 'SCHEMA', N'dbo',
  937. 'TABLE', N'sj_retry_scene_config',
  938. 'COLUMN', N'update_dt'
  939. GO
  940. EXEC sp_addextendedproperty
  941. 'MS_Description', N'场景配置',
  942. 'SCHEMA', N'dbo',
  943. 'TABLE', N'sj_retry_scene_config'
  944. GO
  945. -- sj_server_node
  946. CREATE TABLE sj_server_node
  947. (
  948. id bigint NOT NULL PRIMARY KEY IDENTITY,
  949. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  950. group_name nvarchar(64) NOT NULL,
  951. host_id nvarchar(64) NOT NULL,
  952. host_ip nvarchar(64) NOT NULL,
  953. host_port int NOT NULL,
  954. expire_at datetime2 NOT NULL,
  955. node_type tinyint NOT NULL,
  956. ext_attrs nvarchar(256) NULL DEFAULT '',
  957. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  958. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  959. )
  960. GO
  961. CREATE UNIQUE INDEX uk_sj_server_node_01 ON sj_server_node (host_id, host_ip)
  962. GO
  963. CREATE INDEX idx_sj_server_node_01 ON sj_server_node (namespace_id, group_name)
  964. GO
  965. CREATE INDEX idx_sj_server_node_02 ON sj_server_node (expire_at, node_type)
  966. GO
  967. EXEC sp_addextendedproperty
  968. 'MS_Description', N'主键',
  969. 'SCHEMA', N'dbo',
  970. 'TABLE', N'sj_server_node',
  971. 'COLUMN', N'id'
  972. GO
  973. EXEC sp_addextendedproperty
  974. 'MS_Description', N'命名空间id',
  975. 'SCHEMA', N'dbo',
  976. 'TABLE', N'sj_server_node',
  977. 'COLUMN', N'namespace_id'
  978. GO
  979. EXEC sp_addextendedproperty
  980. 'MS_Description', N'组名称',
  981. 'SCHEMA', N'dbo',
  982. 'TABLE', N'sj_server_node',
  983. 'COLUMN', N'group_name'
  984. GO
  985. EXEC sp_addextendedproperty
  986. 'MS_Description', N'主机id',
  987. 'SCHEMA', N'dbo',
  988. 'TABLE', N'sj_server_node',
  989. 'COLUMN', N'host_id'
  990. GO
  991. EXEC sp_addextendedproperty
  992. 'MS_Description', N'机器ip',
  993. 'SCHEMA', N'dbo',
  994. 'TABLE', N'sj_server_node',
  995. 'COLUMN', N'host_ip'
  996. GO
  997. EXEC sp_addextendedproperty
  998. 'MS_Description', N'机器端口',
  999. 'SCHEMA', N'dbo',
  1000. 'TABLE', N'sj_server_node',
  1001. 'COLUMN', N'host_port'
  1002. GO
  1003. EXEC sp_addextendedproperty
  1004. 'MS_Description', N'过期时间',
  1005. 'SCHEMA', N'dbo',
  1006. 'TABLE', N'sj_server_node',
  1007. 'COLUMN', N'expire_at'
  1008. GO
  1009. EXEC sp_addextendedproperty
  1010. 'MS_Description', N'节点类型 1、客户端 2、是服务端',
  1011. 'SCHEMA', N'dbo',
  1012. 'TABLE', N'sj_server_node',
  1013. 'COLUMN', N'node_type'
  1014. GO
  1015. EXEC sp_addextendedproperty
  1016. 'MS_Description', N'扩展字段',
  1017. 'SCHEMA', N'dbo',
  1018. 'TABLE', N'sj_server_node',
  1019. 'COLUMN', N'ext_attrs'
  1020. GO
  1021. EXEC sp_addextendedproperty
  1022. 'MS_Description', N'创建时间',
  1023. 'SCHEMA', N'dbo',
  1024. 'TABLE', N'sj_server_node',
  1025. 'COLUMN', N'create_dt'
  1026. GO
  1027. EXEC sp_addextendedproperty
  1028. 'MS_Description', N'修改时间',
  1029. 'SCHEMA', N'dbo',
  1030. 'TABLE', N'sj_server_node',
  1031. 'COLUMN', N'update_dt'
  1032. GO
  1033. EXEC sp_addextendedproperty
  1034. 'MS_Description', N'服务器节点',
  1035. 'SCHEMA', N'dbo',
  1036. 'TABLE', N'sj_server_node'
  1037. GO
  1038. -- sj_distributed_lock
  1039. CREATE TABLE sj_distributed_lock
  1040. (
  1041. name nvarchar(64) NOT NULL,
  1042. lock_until datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1043. locked_at datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1044. locked_by nvarchar(255) NOT NULL,
  1045. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1046. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1047. )
  1048. GO
  1049. EXEC sp_addextendedproperty
  1050. 'MS_Description', N'锁名称',
  1051. 'SCHEMA', N'dbo',
  1052. 'TABLE', N'sj_distributed_lock',
  1053. 'COLUMN', N'name'
  1054. GO
  1055. EXEC sp_addextendedproperty
  1056. 'MS_Description', N'锁定时长',
  1057. 'SCHEMA', N'dbo',
  1058. 'TABLE', N'sj_distributed_lock',
  1059. 'COLUMN', N'lock_until'
  1060. GO
  1061. EXEC sp_addextendedproperty
  1062. 'MS_Description', N'锁定时间',
  1063. 'SCHEMA', N'dbo',
  1064. 'TABLE', N'sj_distributed_lock',
  1065. 'COLUMN', N'locked_at'
  1066. GO
  1067. EXEC sp_addextendedproperty
  1068. 'MS_Description', N'锁定者',
  1069. 'SCHEMA', N'dbo',
  1070. 'TABLE', N'sj_distributed_lock',
  1071. 'COLUMN', N'locked_by'
  1072. GO
  1073. EXEC sp_addextendedproperty
  1074. 'MS_Description', N'创建时间',
  1075. 'SCHEMA', N'dbo',
  1076. 'TABLE', N'sj_distributed_lock',
  1077. 'COLUMN', N'create_dt'
  1078. GO
  1079. EXEC sp_addextendedproperty
  1080. 'MS_Description', N'修改时间',
  1081. 'SCHEMA', N'dbo',
  1082. 'TABLE', N'sj_distributed_lock',
  1083. 'COLUMN', N'update_dt'
  1084. GO
  1085. EXEC sp_addextendedproperty
  1086. 'MS_Description', N'锁定表',
  1087. 'SCHEMA', N'dbo',
  1088. 'TABLE', N'sj_distributed_lock'
  1089. GO
  1090. -- sj_system_user
  1091. CREATE TABLE sj_system_user
  1092. (
  1093. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1094. username nvarchar(64) NOT NULL,
  1095. password nvarchar(128) NOT NULL,
  1096. role tinyint NOT NULL DEFAULT 0,
  1097. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1098. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1099. )
  1100. GO
  1101. EXEC sp_addextendedproperty
  1102. 'MS_Description', N'主键',
  1103. 'SCHEMA', N'dbo',
  1104. 'TABLE', N'sj_system_user',
  1105. 'COLUMN', N'id'
  1106. GO
  1107. EXEC sp_addextendedproperty
  1108. 'MS_Description', N'账号',
  1109. 'SCHEMA', N'dbo',
  1110. 'TABLE', N'sj_system_user',
  1111. 'COLUMN', N'username'
  1112. GO
  1113. EXEC sp_addextendedproperty
  1114. 'MS_Description', N'密码',
  1115. 'SCHEMA', N'dbo',
  1116. 'TABLE', N'sj_system_user',
  1117. 'COLUMN', N'password'
  1118. GO
  1119. EXEC sp_addextendedproperty
  1120. 'MS_Description', N'角色:1-普通用户、2-管理员',
  1121. 'SCHEMA', N'dbo',
  1122. 'TABLE', N'sj_system_user',
  1123. 'COLUMN', N'role'
  1124. GO
  1125. EXEC sp_addextendedproperty
  1126. 'MS_Description', N'创建时间',
  1127. 'SCHEMA', N'dbo',
  1128. 'TABLE', N'sj_system_user',
  1129. 'COLUMN', N'create_dt'
  1130. GO
  1131. EXEC sp_addextendedproperty
  1132. 'MS_Description', N'修改时间',
  1133. 'SCHEMA', N'dbo',
  1134. 'TABLE', N'sj_system_user',
  1135. 'COLUMN', N'update_dt'
  1136. GO
  1137. EXEC sp_addextendedproperty
  1138. 'MS_Description', N'系统用户表',
  1139. 'SCHEMA', N'dbo',
  1140. 'TABLE', N'sj_system_user'
  1141. GO
  1142. -- pwd: admin
  1143. INSERT INTO sj_system_user(username, password, role, create_dt, update_dt) VALUES (N'admin', N'465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', N'2', getdate(), getdate())
  1144. GO
  1145. -- sj_system_user_permission
  1146. CREATE TABLE sj_system_user_permission
  1147. (
  1148. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1149. group_name nvarchar(64) NOT NULL,
  1150. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1151. system_user_id bigint NOT NULL,
  1152. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1153. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1154. )
  1155. GO
  1156. CREATE UNIQUE INDEX uk_sj_system_user_permission_01 ON sj_system_user_permission (namespace_id, group_name, system_user_id)
  1157. GO
  1158. EXEC sp_addextendedproperty
  1159. 'MS_Description', N'主键',
  1160. 'SCHEMA', N'dbo',
  1161. 'TABLE', N'sj_system_user_permission',
  1162. 'COLUMN', N'id'
  1163. GO
  1164. EXEC sp_addextendedproperty
  1165. 'MS_Description', N'组名称',
  1166. 'SCHEMA', N'dbo',
  1167. 'TABLE', N'sj_system_user_permission',
  1168. 'COLUMN', N'group_name'
  1169. GO
  1170. EXEC sp_addextendedproperty
  1171. 'MS_Description', N'命名空间id',
  1172. 'SCHEMA', N'dbo',
  1173. 'TABLE', N'sj_system_user_permission',
  1174. 'COLUMN', N'namespace_id'
  1175. GO
  1176. EXEC sp_addextendedproperty
  1177. 'MS_Description', N'系统用户id',
  1178. 'SCHEMA', N'dbo',
  1179. 'TABLE', N'sj_system_user_permission',
  1180. 'COLUMN', N'system_user_id'
  1181. GO
  1182. EXEC sp_addextendedproperty
  1183. 'MS_Description', N'创建时间',
  1184. 'SCHEMA', N'dbo',
  1185. 'TABLE', N'sj_system_user_permission',
  1186. 'COLUMN', N'create_dt'
  1187. GO
  1188. EXEC sp_addextendedproperty
  1189. 'MS_Description', N'修改时间',
  1190. 'SCHEMA', N'dbo',
  1191. 'TABLE', N'sj_system_user_permission',
  1192. 'COLUMN', N'update_dt'
  1193. GO
  1194. EXEC sp_addextendedproperty
  1195. 'MS_Description', N'系统用户权限表',
  1196. 'SCHEMA', N'dbo',
  1197. 'TABLE', N'sj_system_user_permission'
  1198. GO
  1199. -- sj_sequence_alloc
  1200. CREATE TABLE sj_sequence_alloc
  1201. (
  1202. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1203. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1204. group_name nvarchar(64) NOT NULL DEFAULT '',
  1205. max_id bigint NOT NULL DEFAULT 1,
  1206. step int NOT NULL DEFAULT 100,
  1207. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1208. )
  1209. GO
  1210. CREATE UNIQUE INDEX uk_sj_sequence_alloc_01 ON sj_sequence_alloc (namespace_id, group_name)
  1211. GO
  1212. EXEC sp_addextendedproperty
  1213. 'MS_Description', N'主键',
  1214. 'SCHEMA', N'dbo',
  1215. 'TABLE', N'sj_sequence_alloc',
  1216. 'COLUMN', N'id'
  1217. GO
  1218. EXEC sp_addextendedproperty
  1219. 'MS_Description', N'命名空间id',
  1220. 'SCHEMA', N'dbo',
  1221. 'TABLE', N'sj_sequence_alloc',
  1222. 'COLUMN', N'namespace_id'
  1223. GO
  1224. EXEC sp_addextendedproperty
  1225. 'MS_Description', N'组名称',
  1226. 'SCHEMA', N'dbo',
  1227. 'TABLE', N'sj_sequence_alloc',
  1228. 'COLUMN', N'group_name'
  1229. GO
  1230. EXEC sp_addextendedproperty
  1231. 'MS_Description', N'最大id',
  1232. 'SCHEMA', N'dbo',
  1233. 'TABLE', N'sj_sequence_alloc',
  1234. 'COLUMN', N'max_id'
  1235. GO
  1236. EXEC sp_addextendedproperty
  1237. 'MS_Description', N'步长',
  1238. 'SCHEMA', N'dbo',
  1239. 'TABLE', N'sj_sequence_alloc',
  1240. 'COLUMN', N'step'
  1241. GO
  1242. EXEC sp_addextendedproperty
  1243. 'MS_Description', N'更新时间',
  1244. 'SCHEMA', N'dbo',
  1245. 'TABLE', N'sj_sequence_alloc',
  1246. 'COLUMN', N'update_dt'
  1247. GO
  1248. EXEC sp_addextendedproperty
  1249. 'MS_Description', N'号段模式序号ID分配表',
  1250. 'SCHEMA', N'dbo',
  1251. 'TABLE', N'sj_sequence_alloc'
  1252. GO
  1253. -- sj_job
  1254. CREATE TABLE sj_job
  1255. (
  1256. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1257. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1258. group_name nvarchar(64) NOT NULL,
  1259. job_name nvarchar(64) NOT NULL,
  1260. args_str nvarchar(max) NULL DEFAULT NULL,
  1261. args_type tinyint NOT NULL DEFAULT 1,
  1262. next_trigger_at bigint NOT NULL,
  1263. job_status tinyint NOT NULL DEFAULT 1,
  1264. task_type tinyint NOT NULL DEFAULT 1,
  1265. route_key tinyint NOT NULL DEFAULT 4,
  1266. executor_type tinyint NOT NULL DEFAULT 1,
  1267. executor_info nvarchar(255) NULL DEFAULT NULL,
  1268. trigger_type tinyint NOT NULL,
  1269. trigger_interval nvarchar(255) NOT NULL,
  1270. block_strategy tinyint NOT NULL DEFAULT 1,
  1271. executor_timeout int NOT NULL DEFAULT 0,
  1272. max_retry_times int NOT NULL DEFAULT 0,
  1273. parallel_num int NOT NULL DEFAULT 1,
  1274. retry_interval int NOT NULL DEFAULT 0,
  1275. bucket_index int NOT NULL DEFAULT 0,
  1276. resident tinyint NOT NULL DEFAULT 0,
  1277. notify_ids nvarchar(128) NOT NULL DEFAULT '',
  1278. owner_id bigint NULL,
  1279. description nvarchar(256) NOT NULL DEFAULT '',
  1280. ext_attrs nvarchar(256) NULL DEFAULT '',
  1281. deleted tinyint NOT NULL DEFAULT 0,
  1282. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1283. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1284. )
  1285. GO
  1286. CREATE INDEX idx_sj_job_01 ON sj_job (namespace_id, group_name)
  1287. GO
  1288. CREATE INDEX idx_sj_job_02 ON sj_job (job_status, bucket_index)
  1289. GO
  1290. CREATE INDEX idx_sj_job_03 ON sj_job (create_dt)
  1291. GO
  1292. EXEC sp_addextendedproperty
  1293. 'MS_Description', N'主键',
  1294. 'SCHEMA', N'dbo',
  1295. 'TABLE', N'sj_job',
  1296. 'COLUMN', N'id'
  1297. GO
  1298. EXEC sp_addextendedproperty
  1299. 'MS_Description', N'命名空间id',
  1300. 'SCHEMA', N'dbo',
  1301. 'TABLE', N'sj_job',
  1302. 'COLUMN', N'namespace_id'
  1303. GO
  1304. EXEC sp_addextendedproperty
  1305. 'MS_Description', N'组名称',
  1306. 'SCHEMA', N'dbo',
  1307. 'TABLE', N'sj_job',
  1308. 'COLUMN', N'group_name'
  1309. GO
  1310. EXEC sp_addextendedproperty
  1311. 'MS_Description', N'名称',
  1312. 'SCHEMA', N'dbo',
  1313. 'TABLE', N'sj_job',
  1314. 'COLUMN', N'job_name'
  1315. GO
  1316. EXEC sp_addextendedproperty
  1317. 'MS_Description', N'执行方法参数',
  1318. 'SCHEMA', N'dbo',
  1319. 'TABLE', N'sj_job',
  1320. 'COLUMN', N'args_str'
  1321. GO
  1322. EXEC sp_addextendedproperty
  1323. 'MS_Description', N'参数类型 ',
  1324. 'SCHEMA', N'dbo',
  1325. 'TABLE', N'sj_job',
  1326. 'COLUMN', N'args_type'
  1327. GO
  1328. EXEC sp_addextendedproperty
  1329. 'MS_Description', N'下次触发时间',
  1330. 'SCHEMA', N'dbo',
  1331. 'TABLE', N'sj_job',
  1332. 'COLUMN', N'next_trigger_at'
  1333. GO
  1334. EXEC sp_addextendedproperty
  1335. 'MS_Description', N'任务状态 0、关闭、1、开启',
  1336. 'SCHEMA', N'dbo',
  1337. 'TABLE', N'sj_job',
  1338. 'COLUMN', N'job_status'
  1339. GO
  1340. EXEC sp_addextendedproperty
  1341. 'MS_Description', N'任务类型 1、集群 2、广播 3、切片',
  1342. 'SCHEMA', N'dbo',
  1343. 'TABLE', N'sj_job',
  1344. 'COLUMN', N'task_type'
  1345. GO
  1346. EXEC sp_addextendedproperty
  1347. 'MS_Description', N'路由策略',
  1348. 'SCHEMA', N'dbo',
  1349. 'TABLE', N'sj_job',
  1350. 'COLUMN', N'route_key'
  1351. GO
  1352. EXEC sp_addextendedproperty
  1353. 'MS_Description', N'执行器类型',
  1354. 'SCHEMA', N'dbo',
  1355. 'TABLE', N'sj_job',
  1356. 'COLUMN', N'executor_type'
  1357. GO
  1358. EXEC sp_addextendedproperty
  1359. 'MS_Description', N'执行器名称',
  1360. 'SCHEMA', N'dbo',
  1361. 'TABLE', N'sj_job',
  1362. 'COLUMN', N'executor_info'
  1363. GO
  1364. EXEC sp_addextendedproperty
  1365. 'MS_Description', N'触发类型 1.CRON 表达式 2. 固定时间',
  1366. 'SCHEMA', N'dbo',
  1367. 'TABLE', N'sj_job',
  1368. 'COLUMN', N'trigger_type'
  1369. GO
  1370. EXEC sp_addextendedproperty
  1371. 'MS_Description', N'间隔时长',
  1372. 'SCHEMA', N'dbo',
  1373. 'TABLE', N'sj_job',
  1374. 'COLUMN', N'trigger_interval'
  1375. GO
  1376. EXEC sp_addextendedproperty
  1377. 'MS_Description', N'阻塞策略 1、丢弃 2、覆盖 3、并行 4、恢复',
  1378. 'SCHEMA', N'dbo',
  1379. 'TABLE', N'sj_job',
  1380. 'COLUMN', N'block_strategy'
  1381. GO
  1382. EXEC sp_addextendedproperty
  1383. 'MS_Description', N'任务执行超时时间,单位秒',
  1384. 'SCHEMA', N'dbo',
  1385. 'TABLE', N'sj_job',
  1386. 'COLUMN', N'executor_timeout'
  1387. GO
  1388. EXEC sp_addextendedproperty
  1389. 'MS_Description', N'最大重试次数',
  1390. 'SCHEMA', N'dbo',
  1391. 'TABLE', N'sj_job',
  1392. 'COLUMN', N'max_retry_times'
  1393. GO
  1394. EXEC sp_addextendedproperty
  1395. 'MS_Description', N'并行数',
  1396. 'SCHEMA', N'dbo',
  1397. 'TABLE', N'sj_job',
  1398. 'COLUMN', N'parallel_num'
  1399. GO
  1400. EXEC sp_addextendedproperty
  1401. 'MS_Description', N'重试间隔 ( s)',
  1402. 'SCHEMA', N'dbo',
  1403. 'TABLE', N'sj_job',
  1404. 'COLUMN', N'retry_interval'
  1405. GO
  1406. EXEC sp_addextendedproperty
  1407. 'MS_Description', N'bucket',
  1408. 'SCHEMA', N'dbo',
  1409. 'TABLE', N'sj_job',
  1410. 'COLUMN', N'bucket_index'
  1411. GO
  1412. EXEC sp_addextendedproperty
  1413. 'MS_Description', N'是否是常驻任务',
  1414. 'SCHEMA', N'dbo',
  1415. 'TABLE', N'sj_job',
  1416. 'COLUMN', N'resident'
  1417. GO
  1418. EXEC sp_addextendedproperty
  1419. 'MS_Description', N'通知告警场景配置id列表',
  1420. 'SCHEMA', N'dbo',
  1421. 'TABLE', N'sj_job',
  1422. 'COLUMN', N'notify_ids'
  1423. GO
  1424. EXEC sp_addextendedproperty
  1425. 'MS_Description', N'负责人id',
  1426. 'SCHEMA', N'dbo',
  1427. 'TABLE', N'sj_job',
  1428. 'COLUMN', N'owner_id'
  1429. GO
  1430. EXEC sp_addextendedproperty
  1431. 'MS_Description', N'描述',
  1432. 'SCHEMA', N'dbo',
  1433. 'TABLE', N'sj_job',
  1434. 'COLUMN', N'description'
  1435. GO
  1436. EXEC sp_addextendedproperty
  1437. 'MS_Description', N'扩展字段',
  1438. 'SCHEMA', N'dbo',
  1439. 'TABLE', N'sj_job',
  1440. 'COLUMN', N'ext_attrs'
  1441. GO
  1442. EXEC sp_addextendedproperty
  1443. 'MS_Description', N'逻辑删除 1、删除',
  1444. 'SCHEMA', N'dbo',
  1445. 'TABLE', N'sj_job',
  1446. 'COLUMN', N'deleted'
  1447. GO
  1448. EXEC sp_addextendedproperty
  1449. 'MS_Description', N'创建时间',
  1450. 'SCHEMA', N'dbo',
  1451. 'TABLE', N'sj_job',
  1452. 'COLUMN', N'create_dt'
  1453. GO
  1454. EXEC sp_addextendedproperty
  1455. 'MS_Description', N'修改时间',
  1456. 'SCHEMA', N'dbo',
  1457. 'TABLE', N'sj_job',
  1458. 'COLUMN', N'update_dt'
  1459. GO
  1460. EXEC sp_addextendedproperty
  1461. 'MS_Description', N'任务信息',
  1462. 'SCHEMA', N'dbo',
  1463. 'TABLE', N'sj_job'
  1464. GO
  1465. INSERT INTO sj_job (namespace_id, group_name, job_name, args_str, args_type, next_trigger_at, job_status, task_type, route_key, executor_type, executor_info, trigger_type, trigger_interval, block_strategy,executor_timeout, max_retry_times, parallel_num, retry_interval, bucket_index, resident, notify_ids, owner_id, description, ext_attrs, deleted, create_dt, update_dt) VALUES (N'dev', N'ruoyi_group', N'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, N'testJobExecutor', 2, N'60', 1, 60, 3, 1, 1, 116, 0, N'', 1, N'', N'', 0, getdate(), getdate())
  1466. GO
  1467. -- sj_job_log_message
  1468. CREATE TABLE sj_job_log_message
  1469. (
  1470. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1471. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1472. group_name nvarchar(64) NOT NULL,
  1473. job_id bigint NOT NULL,
  1474. task_batch_id bigint NOT NULL,
  1475. task_id bigint NOT NULL,
  1476. message nvarchar(max) NOT NULL,
  1477. log_num int NOT NULL DEFAULT 1,
  1478. real_time bigint NOT NULL DEFAULT 0,
  1479. ext_attrs nvarchar(256) NULL DEFAULT '',
  1480. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1481. )
  1482. GO
  1483. CREATE INDEX idx_sj_job_log_message_01 ON sj_job_log_message (task_batch_id, task_id)
  1484. GO
  1485. CREATE INDEX idx_sj_job_log_message_02 ON sj_job_log_message (create_dt)
  1486. GO
  1487. CREATE INDEX idx_sj_job_log_message_03 ON sj_job_log_message (namespace_id, group_name)
  1488. GO
  1489. EXEC sp_addextendedproperty
  1490. 'MS_Description', N'主键',
  1491. 'SCHEMA', N'dbo',
  1492. 'TABLE', N'sj_job_log_message',
  1493. 'COLUMN', N'id'
  1494. GO
  1495. EXEC sp_addextendedproperty
  1496. 'MS_Description', N'命名空间id',
  1497. 'SCHEMA', N'dbo',
  1498. 'TABLE', N'sj_job_log_message',
  1499. 'COLUMN', N'namespace_id'
  1500. GO
  1501. EXEC sp_addextendedproperty
  1502. 'MS_Description', N'组名称',
  1503. 'SCHEMA', N'dbo',
  1504. 'TABLE', N'sj_job_log_message',
  1505. 'COLUMN', N'group_name'
  1506. GO
  1507. EXEC sp_addextendedproperty
  1508. 'MS_Description', N'任务信息id',
  1509. 'SCHEMA', N'dbo',
  1510. 'TABLE', N'sj_job_log_message',
  1511. 'COLUMN', N'job_id'
  1512. GO
  1513. EXEC sp_addextendedproperty
  1514. 'MS_Description', N'任务批次id',
  1515. 'SCHEMA', N'dbo',
  1516. 'TABLE', N'sj_job_log_message',
  1517. 'COLUMN', N'task_batch_id'
  1518. GO
  1519. EXEC sp_addextendedproperty
  1520. 'MS_Description', N'调度任务id',
  1521. 'SCHEMA', N'dbo',
  1522. 'TABLE', N'sj_job_log_message',
  1523. 'COLUMN', N'task_id'
  1524. GO
  1525. EXEC sp_addextendedproperty
  1526. 'MS_Description', N'调度信息',
  1527. 'SCHEMA', N'dbo',
  1528. 'TABLE', N'sj_job_log_message',
  1529. 'COLUMN', N'message'
  1530. GO
  1531. EXEC sp_addextendedproperty
  1532. 'MS_Description', N'日志数量',
  1533. 'SCHEMA', N'dbo',
  1534. 'TABLE', N'sj_job_log_message',
  1535. 'COLUMN', N'log_num'
  1536. GO
  1537. EXEC sp_addextendedproperty
  1538. 'MS_Description', N'上报时间',
  1539. 'SCHEMA', N'dbo',
  1540. 'TABLE', N'sj_job_log_message',
  1541. 'COLUMN', N'real_time'
  1542. GO
  1543. EXEC sp_addextendedproperty
  1544. 'MS_Description', N'扩展字段',
  1545. 'SCHEMA', N'dbo',
  1546. 'TABLE', N'sj_job_log_message',
  1547. 'COLUMN', N'ext_attrs'
  1548. GO
  1549. EXEC sp_addextendedproperty
  1550. 'MS_Description', N'创建时间',
  1551. 'SCHEMA', N'dbo',
  1552. 'TABLE', N'sj_job_log_message',
  1553. 'COLUMN', N'create_dt'
  1554. GO
  1555. EXEC sp_addextendedproperty
  1556. 'MS_Description', N'调度日志',
  1557. 'SCHEMA', N'dbo',
  1558. 'TABLE', N'sj_job_log_message'
  1559. GO
  1560. -- sj_job_task
  1561. CREATE TABLE sj_job_task
  1562. (
  1563. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1564. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1565. group_name nvarchar(64) NOT NULL,
  1566. job_id bigint NOT NULL,
  1567. task_batch_id bigint NOT NULL,
  1568. parent_id bigint NOT NULL DEFAULT 0,
  1569. task_status tinyint NOT NULL DEFAULT 0,
  1570. retry_count int NOT NULL DEFAULT 0,
  1571. mr_stage tinyint NULL DEFAULT NULL,
  1572. leaf tinyint NOT NULL DEFAULT '1',
  1573. task_name nvarchar(255) NOT NULL DEFAULT '',
  1574. client_info nvarchar(128) NULL DEFAULT NULL,
  1575. wf_context nvarchar(max) NULL DEFAULT NULL,
  1576. result_message nvarchar(max) NOT NULL,
  1577. args_str nvarchar(max) NULL DEFAULT NULL,
  1578. args_type tinyint NOT NULL DEFAULT 1,
  1579. ext_attrs nvarchar(256) NULL DEFAULT '',
  1580. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1581. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1582. )
  1583. GO
  1584. CREATE INDEX idx_sj_job_task_01 ON sj_job_task (task_batch_id, task_status)
  1585. GO
  1586. CREATE INDEX idx_sj_job_task_02 ON sj_job_task (create_dt)
  1587. GO
  1588. CREATE INDEX idx_sj_job_task_03 ON sj_job_task (namespace_id, group_name)
  1589. GO
  1590. EXEC sp_addextendedproperty
  1591. 'MS_Description', N'主键',
  1592. 'SCHEMA', N'dbo',
  1593. 'TABLE', N'sj_job_task',
  1594. 'COLUMN', N'id'
  1595. GO
  1596. EXEC sp_addextendedproperty
  1597. 'MS_Description', N'命名空间id',
  1598. 'SCHEMA', N'dbo',
  1599. 'TABLE', N'sj_job_task',
  1600. 'COLUMN', N'namespace_id'
  1601. GO
  1602. EXEC sp_addextendedproperty
  1603. 'MS_Description', N'组名称',
  1604. 'SCHEMA', N'dbo',
  1605. 'TABLE', N'sj_job_task',
  1606. 'COLUMN', N'group_name'
  1607. GO
  1608. EXEC sp_addextendedproperty
  1609. 'MS_Description', N'任务信息id',
  1610. 'SCHEMA', N'dbo',
  1611. 'TABLE', N'sj_job_task',
  1612. 'COLUMN', N'job_id'
  1613. GO
  1614. EXEC sp_addextendedproperty
  1615. 'MS_Description', N'调度任务id',
  1616. 'SCHEMA', N'dbo',
  1617. 'TABLE', N'sj_job_task',
  1618. 'COLUMN', N'task_batch_id'
  1619. GO
  1620. EXEC sp_addextendedproperty
  1621. 'MS_Description', N'父执行器id',
  1622. 'SCHEMA', N'dbo',
  1623. 'TABLE', N'sj_job_task',
  1624. 'COLUMN', N'parent_id'
  1625. GO
  1626. EXEC sp_addextendedproperty
  1627. 'MS_Description', N'执行的状态 0、失败 1、成功',
  1628. 'SCHEMA', N'dbo',
  1629. 'TABLE', N'sj_job_task',
  1630. 'COLUMN', N'task_status'
  1631. GO
  1632. EXEC sp_addextendedproperty
  1633. 'MS_Description', N'重试次数',
  1634. 'SCHEMA', N'dbo',
  1635. 'TABLE', N'sj_job_task',
  1636. 'COLUMN', N'retry_count'
  1637. GO
  1638. EXEC sp_addextendedproperty
  1639. 'MS_Description', N'动态分片所处阶段 1:map 2:reduce 3:mergeReduce',
  1640. 'SCHEMA', N'dbo',
  1641. 'TABLE', N'sj_job_task',
  1642. 'COLUMN', N'mr_stage'
  1643. GO
  1644. EXEC sp_addextendedproperty
  1645. 'MS_Description', N'叶子节点',
  1646. 'SCHEMA', N'dbo',
  1647. 'TABLE', N'sj_job_task',
  1648. 'COLUMN', N'leaf'
  1649. GO
  1650. EXEC sp_addextendedproperty
  1651. 'MS_Description', N'任务名称',
  1652. 'SCHEMA', N'dbo',
  1653. 'TABLE', N'sj_job_task',
  1654. 'COLUMN', N'task_name'
  1655. GO
  1656. EXEC sp_addextendedproperty
  1657. 'MS_Description', N'客户端地址 clientId#ip:port',
  1658. 'SCHEMA', N'dbo',
  1659. 'TABLE', N'sj_job_task',
  1660. 'COLUMN', N'client_info'
  1661. GO
  1662. EXEC sp_addextendedproperty
  1663. 'MS_Description', N'工作流全局上下文',
  1664. 'SCHEMA', N'dbo',
  1665. 'TABLE', N'sj_job_task',
  1666. 'COLUMN', N'wf_context'
  1667. GO
  1668. EXEC sp_addextendedproperty
  1669. 'MS_Description', N'执行结果',
  1670. 'SCHEMA', N'dbo',
  1671. 'TABLE', N'sj_job_task',
  1672. 'COLUMN', N'result_message'
  1673. GO
  1674. EXEC sp_addextendedproperty
  1675. 'MS_Description', N'执行方法参数',
  1676. 'SCHEMA', N'dbo',
  1677. 'TABLE', N'sj_job_task',
  1678. 'COLUMN', N'args_str'
  1679. GO
  1680. EXEC sp_addextendedproperty
  1681. 'MS_Description', N'参数类型 ',
  1682. 'SCHEMA', N'dbo',
  1683. 'TABLE', N'sj_job_task',
  1684. 'COLUMN', N'args_type'
  1685. GO
  1686. EXEC sp_addextendedproperty
  1687. 'MS_Description', N'扩展字段',
  1688. 'SCHEMA', N'dbo',
  1689. 'TABLE', N'sj_job_task',
  1690. 'COLUMN', N'ext_attrs'
  1691. GO
  1692. EXEC sp_addextendedproperty
  1693. 'MS_Description', N'创建时间',
  1694. 'SCHEMA', N'dbo',
  1695. 'TABLE', N'sj_job_task',
  1696. 'COLUMN', N'create_dt'
  1697. GO
  1698. EXEC sp_addextendedproperty
  1699. 'MS_Description', N'修改时间',
  1700. 'SCHEMA', N'dbo',
  1701. 'TABLE', N'sj_job_task',
  1702. 'COLUMN', N'update_dt'
  1703. GO
  1704. EXEC sp_addextendedproperty
  1705. 'MS_Description', N'任务实例',
  1706. 'SCHEMA', N'dbo',
  1707. 'TABLE', N'sj_job_task'
  1708. GO
  1709. -- sj_job_task_batch
  1710. CREATE TABLE sj_job_task_batch
  1711. (
  1712. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1713. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1714. group_name nvarchar(64) NOT NULL,
  1715. job_id bigint NOT NULL,
  1716. workflow_node_id bigint NOT NULL DEFAULT 0,
  1717. parent_workflow_node_id bigint NOT NULL DEFAULT 0,
  1718. workflow_task_batch_id bigint NOT NULL DEFAULT 0,
  1719. task_batch_status tinyint NOT NULL DEFAULT 0,
  1720. operation_reason tinyint NOT NULL DEFAULT 0,
  1721. execution_at bigint NOT NULL DEFAULT 0,
  1722. system_task_type tinyint NOT NULL DEFAULT 3,
  1723. parent_id nvarchar(64) NOT NULL DEFAULT '',
  1724. ext_attrs nvarchar(256) NULL DEFAULT '',
  1725. deleted tinyint NOT NULL DEFAULT 0,
  1726. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1727. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1728. )
  1729. GO
  1730. CREATE INDEX idx_sj_job_task_batch_01 ON sj_job_task_batch (job_id, task_batch_status)
  1731. GO
  1732. CREATE INDEX idx_sj_job_task_batch_02 ON sj_job_task_batch (create_dt)
  1733. GO
  1734. CREATE INDEX idx_sj_job_task_batch_03 ON sj_job_task_batch (namespace_id, group_name)
  1735. GO
  1736. CREATE INDEX idx_sj_job_task_batch_04 ON sj_job_task_batch (workflow_task_batch_id, workflow_node_id)
  1737. GO
  1738. EXEC sp_addextendedproperty
  1739. 'MS_Description', N'主键',
  1740. 'SCHEMA', N'dbo',
  1741. 'TABLE', N'sj_job_task_batch',
  1742. 'COLUMN', N'id'
  1743. GO
  1744. EXEC sp_addextendedproperty
  1745. 'MS_Description', N'命名空间id',
  1746. 'SCHEMA', N'dbo',
  1747. 'TABLE', N'sj_job_task_batch',
  1748. 'COLUMN', N'namespace_id'
  1749. GO
  1750. EXEC sp_addextendedproperty
  1751. 'MS_Description', N'组名称',
  1752. 'SCHEMA', N'dbo',
  1753. 'TABLE', N'sj_job_task_batch',
  1754. 'COLUMN', N'group_name'
  1755. GO
  1756. EXEC sp_addextendedproperty
  1757. 'MS_Description', N'任务id',
  1758. 'SCHEMA', N'dbo',
  1759. 'TABLE', N'sj_job_task_batch',
  1760. 'COLUMN', N'job_id'
  1761. GO
  1762. EXEC sp_addextendedproperty
  1763. 'MS_Description', N'工作流节点id',
  1764. 'SCHEMA', N'dbo',
  1765. 'TABLE', N'sj_job_task_batch',
  1766. 'COLUMN', N'workflow_node_id'
  1767. GO
  1768. EXEC sp_addextendedproperty
  1769. 'MS_Description', N'工作流任务父批次id',
  1770. 'SCHEMA', N'dbo',
  1771. 'TABLE', N'sj_job_task_batch',
  1772. 'COLUMN', N'parent_workflow_node_id'
  1773. GO
  1774. EXEC sp_addextendedproperty
  1775. 'MS_Description', N'工作流任务批次id',
  1776. 'SCHEMA', N'dbo',
  1777. 'TABLE', N'sj_job_task_batch',
  1778. 'COLUMN', N'workflow_task_batch_id'
  1779. GO
  1780. EXEC sp_addextendedproperty
  1781. 'MS_Description', N'任务批次状态 0、失败 1、成功',
  1782. 'SCHEMA', N'dbo',
  1783. 'TABLE', N'sj_job_task_batch',
  1784. 'COLUMN', N'task_batch_status'
  1785. GO
  1786. EXEC sp_addextendedproperty
  1787. 'MS_Description', N'操作原因',
  1788. 'SCHEMA', N'dbo',
  1789. 'TABLE', N'sj_job_task_batch',
  1790. 'COLUMN', N'operation_reason'
  1791. GO
  1792. EXEC sp_addextendedproperty
  1793. 'MS_Description', N'任务执行时间',
  1794. 'SCHEMA', N'dbo',
  1795. 'TABLE', N'sj_job_task_batch',
  1796. 'COLUMN', N'execution_at'
  1797. GO
  1798. EXEC sp_addextendedproperty
  1799. 'MS_Description', N'任务类型 3、JOB任务 4、WORKFLOW任务',
  1800. 'SCHEMA', N'dbo',
  1801. 'TABLE', N'sj_job_task_batch',
  1802. 'COLUMN', N'system_task_type'
  1803. GO
  1804. EXEC sp_addextendedproperty
  1805. 'MS_Description', N'父节点',
  1806. 'SCHEMA', N'dbo',
  1807. 'TABLE', N'sj_job_task_batch',
  1808. 'COLUMN', N'parent_id'
  1809. GO
  1810. EXEC sp_addextendedproperty
  1811. 'MS_Description', N'扩展字段',
  1812. 'SCHEMA', N'dbo',
  1813. 'TABLE', N'sj_job_task_batch',
  1814. 'COLUMN', N'ext_attrs'
  1815. GO
  1816. EXEC sp_addextendedproperty
  1817. 'MS_Description', N'逻辑删除 1、删除',
  1818. 'SCHEMA', N'dbo',
  1819. 'TABLE', N'sj_job_task_batch',
  1820. 'COLUMN', N'deleted'
  1821. GO
  1822. EXEC sp_addextendedproperty
  1823. 'MS_Description', N'创建时间',
  1824. 'SCHEMA', N'dbo',
  1825. 'TABLE', N'sj_job_task_batch',
  1826. 'COLUMN', N'create_dt'
  1827. GO
  1828. EXEC sp_addextendedproperty
  1829. 'MS_Description', N'修改时间',
  1830. 'SCHEMA', N'dbo',
  1831. 'TABLE', N'sj_job_task_batch',
  1832. 'COLUMN', N'update_dt'
  1833. GO
  1834. EXEC sp_addextendedproperty
  1835. 'MS_Description', N'任务批次',
  1836. 'SCHEMA', N'dbo',
  1837. 'TABLE', N'sj_job_task_batch'
  1838. GO
  1839. -- sj_job_summary
  1840. CREATE TABLE sj_job_summary
  1841. (
  1842. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1843. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1844. group_name nvarchar(64) NOT NULL DEFAULT '',
  1845. business_id bigint NOT NULL,
  1846. system_task_type tinyint NOT NULL DEFAULT 3,
  1847. trigger_at datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1848. success_num int NOT NULL DEFAULT 0,
  1849. fail_num int NOT NULL DEFAULT 0,
  1850. fail_reason nvarchar(512) NOT NULL DEFAULT '',
  1851. stop_num int NOT NULL DEFAULT 0,
  1852. stop_reason nvarchar(512) NOT NULL DEFAULT '',
  1853. cancel_num int NOT NULL DEFAULT 0,
  1854. cancel_reason nvarchar(512) NOT NULL DEFAULT '',
  1855. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1856. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1857. )
  1858. GO
  1859. CREATE UNIQUE INDEX uk_sj_job_summary_01 ON sj_job_summary (trigger_at, system_task_type, business_id)
  1860. GO
  1861. CREATE INDEX idx_sj_job_summary_01 ON sj_job_summary (namespace_id, group_name, business_id)
  1862. GO
  1863. EXEC sp_addextendedproperty
  1864. 'MS_Description', N'主键',
  1865. 'SCHEMA', N'dbo',
  1866. 'TABLE', N'sj_job_summary',
  1867. 'COLUMN', N'id'
  1868. GO
  1869. EXEC sp_addextendedproperty
  1870. 'MS_Description', N'命名空间id',
  1871. 'SCHEMA', N'dbo',
  1872. 'TABLE', N'sj_job_summary',
  1873. 'COLUMN', N'namespace_id'
  1874. GO
  1875. EXEC sp_addextendedproperty
  1876. 'MS_Description', N'组名称',
  1877. 'SCHEMA', N'dbo',
  1878. 'TABLE', N'sj_job_summary',
  1879. 'COLUMN', N'group_name'
  1880. GO
  1881. EXEC sp_addextendedproperty
  1882. 'MS_Description', N'业务id ( job_id或workflow_id)',
  1883. 'SCHEMA', N'dbo',
  1884. 'TABLE', N'sj_job_summary',
  1885. 'COLUMN', N'business_id'
  1886. GO
  1887. EXEC sp_addextendedproperty
  1888. 'MS_Description', N'任务类型 3、JOB任务 4、WORKFLOW任务',
  1889. 'SCHEMA', N'dbo',
  1890. 'TABLE', N'sj_job_summary',
  1891. 'COLUMN', N'system_task_type'
  1892. GO
  1893. EXEC sp_addextendedproperty
  1894. 'MS_Description', N'统计时间',
  1895. 'SCHEMA', N'dbo',
  1896. 'TABLE', N'sj_job_summary',
  1897. 'COLUMN', N'trigger_at'
  1898. GO
  1899. EXEC sp_addextendedproperty
  1900. 'MS_Description', N'执行成功-日志数量',
  1901. 'SCHEMA', N'dbo',
  1902. 'TABLE', N'sj_job_summary',
  1903. 'COLUMN', N'success_num'
  1904. GO
  1905. EXEC sp_addextendedproperty
  1906. 'MS_Description', N'执行失败-日志数量',
  1907. 'SCHEMA', N'dbo',
  1908. 'TABLE', N'sj_job_summary',
  1909. 'COLUMN', N'fail_num'
  1910. GO
  1911. EXEC sp_addextendedproperty
  1912. 'MS_Description', N'失败原因',
  1913. 'SCHEMA', N'dbo',
  1914. 'TABLE', N'sj_job_summary',
  1915. 'COLUMN', N'fail_reason'
  1916. GO
  1917. EXEC sp_addextendedproperty
  1918. 'MS_Description', N'执行失败-日志数量',
  1919. 'SCHEMA', N'dbo',
  1920. 'TABLE', N'sj_job_summary',
  1921. 'COLUMN', N'stop_num'
  1922. GO
  1923. EXEC sp_addextendedproperty
  1924. 'MS_Description', N'失败原因',
  1925. 'SCHEMA', N'dbo',
  1926. 'TABLE', N'sj_job_summary',
  1927. 'COLUMN', N'stop_reason'
  1928. GO
  1929. EXEC sp_addextendedproperty
  1930. 'MS_Description', N'执行失败-日志数量',
  1931. 'SCHEMA', N'dbo',
  1932. 'TABLE', N'sj_job_summary',
  1933. 'COLUMN', N'cancel_num'
  1934. GO
  1935. EXEC sp_addextendedproperty
  1936. 'MS_Description', N'失败原因',
  1937. 'SCHEMA', N'dbo',
  1938. 'TABLE', N'sj_job_summary',
  1939. 'COLUMN', N'cancel_reason'
  1940. GO
  1941. EXEC sp_addextendedproperty
  1942. 'MS_Description', N'创建时间',
  1943. 'SCHEMA', N'dbo',
  1944. 'TABLE', N'sj_job_summary',
  1945. 'COLUMN', N'create_dt'
  1946. GO
  1947. EXEC sp_addextendedproperty
  1948. 'MS_Description', N'修改时间',
  1949. 'SCHEMA', N'dbo',
  1950. 'TABLE', N'sj_job_summary',
  1951. 'COLUMN', N'update_dt'
  1952. GO
  1953. EXEC sp_addextendedproperty
  1954. 'MS_Description', N'DashBoard_Job',
  1955. 'SCHEMA', N'dbo',
  1956. 'TABLE', N'sj_job_summary'
  1957. GO
  1958. -- sj_retry_summary
  1959. CREATE TABLE sj_retry_summary
  1960. (
  1961. id bigint NOT NULL PRIMARY KEY IDENTITY,
  1962. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  1963. group_name nvarchar(64) NOT NULL DEFAULT '',
  1964. scene_name nvarchar(50) NOT NULL DEFAULT '',
  1965. trigger_at datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1966. running_num int NOT NULL DEFAULT 0,
  1967. finish_num int NOT NULL DEFAULT 0,
  1968. max_count_num int NOT NULL DEFAULT 0,
  1969. suspend_num int NOT NULL DEFAULT 0,
  1970. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  1971. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  1972. )
  1973. GO
  1974. CREATE UNIQUE INDEX uk_sj_retry_summary_01 ON sj_retry_summary (namespace_id, group_name, scene_name, trigger_at)
  1975. GO
  1976. CREATE INDEX idx_sj_retry_summary_01 ON sj_retry_summary (trigger_at)
  1977. GO
  1978. EXEC sp_addextendedproperty
  1979. 'MS_Description', N'主键',
  1980. 'SCHEMA', N'dbo',
  1981. 'TABLE', N'sj_retry_summary',
  1982. 'COLUMN', N'id'
  1983. GO
  1984. EXEC sp_addextendedproperty
  1985. 'MS_Description', N'命名空间id',
  1986. 'SCHEMA', N'dbo',
  1987. 'TABLE', N'sj_retry_summary',
  1988. 'COLUMN', N'namespace_id'
  1989. GO
  1990. EXEC sp_addextendedproperty
  1991. 'MS_Description', N'组名称',
  1992. 'SCHEMA', N'dbo',
  1993. 'TABLE', N'sj_retry_summary',
  1994. 'COLUMN', N'group_name'
  1995. GO
  1996. EXEC sp_addextendedproperty
  1997. 'MS_Description', N'场景名称',
  1998. 'SCHEMA', N'dbo',
  1999. 'TABLE', N'sj_retry_summary',
  2000. 'COLUMN', N'scene_name'
  2001. GO
  2002. EXEC sp_addextendedproperty
  2003. 'MS_Description', N'统计时间',
  2004. 'SCHEMA', N'dbo',
  2005. 'TABLE', N'sj_retry_summary',
  2006. 'COLUMN', N'trigger_at'
  2007. GO
  2008. EXEC sp_addextendedproperty
  2009. 'MS_Description', N'重试中-日志数量',
  2010. 'SCHEMA', N'dbo',
  2011. 'TABLE', N'sj_retry_summary',
  2012. 'COLUMN', N'running_num'
  2013. GO
  2014. EXEC sp_addextendedproperty
  2015. 'MS_Description', N'重试完成-日志数量',
  2016. 'SCHEMA', N'dbo',
  2017. 'TABLE', N'sj_retry_summary',
  2018. 'COLUMN', N'finish_num'
  2019. GO
  2020. EXEC sp_addextendedproperty
  2021. 'MS_Description', N'重试到达最大次数-日志数量',
  2022. 'SCHEMA', N'dbo',
  2023. 'TABLE', N'sj_retry_summary',
  2024. 'COLUMN', N'max_count_num'
  2025. GO
  2026. EXEC sp_addextendedproperty
  2027. 'MS_Description', N'暂停重试-日志数量',
  2028. 'SCHEMA', N'dbo',
  2029. 'TABLE', N'sj_retry_summary',
  2030. 'COLUMN', N'suspend_num'
  2031. GO
  2032. EXEC sp_addextendedproperty
  2033. 'MS_Description', N'创建时间',
  2034. 'SCHEMA', N'dbo',
  2035. 'TABLE', N'sj_retry_summary',
  2036. 'COLUMN', N'create_dt'
  2037. GO
  2038. EXEC sp_addextendedproperty
  2039. 'MS_Description', N'修改时间',
  2040. 'SCHEMA', N'dbo',
  2041. 'TABLE', N'sj_retry_summary',
  2042. 'COLUMN', N'update_dt'
  2043. GO
  2044. EXEC sp_addextendedproperty
  2045. 'MS_Description', N'DashBoard_Retry',
  2046. 'SCHEMA', N'dbo',
  2047. 'TABLE', N'sj_retry_summary'
  2048. GO
  2049. -- sj_workflow
  2050. CREATE TABLE sj_workflow
  2051. (
  2052. id bigint NOT NULL PRIMARY KEY IDENTITY,
  2053. workflow_name nvarchar(64) NOT NULL,
  2054. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  2055. group_name nvarchar(64) NOT NULL,
  2056. workflow_status tinyint NOT NULL DEFAULT 1,
  2057. trigger_type tinyint NOT NULL,
  2058. trigger_interval nvarchar(255) NOT NULL,
  2059. next_trigger_at bigint NOT NULL,
  2060. block_strategy tinyint NOT NULL DEFAULT 1,
  2061. executor_timeout int NOT NULL DEFAULT 0,
  2062. description nvarchar(256) NOT NULL DEFAULT '',
  2063. flow_info nvarchar(max) NULL DEFAULT NULL,
  2064. wf_context nvarchar(max) NULL DEFAULT NULL,
  2065. notify_ids nvarchar(128) NOT NULL DEFAULT '',
  2066. bucket_index int NOT NULL DEFAULT 0,
  2067. version int NOT NULL,
  2068. ext_attrs nvarchar(256) NULL DEFAULT '',
  2069. deleted tinyint NOT NULL DEFAULT 0,
  2070. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  2071. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  2072. )
  2073. GO
  2074. CREATE INDEX idx_sj_workflow_01 ON sj_workflow (create_dt)
  2075. GO
  2076. CREATE INDEX idx_sj_workflow_02 ON sj_workflow (namespace_id, group_name)
  2077. GO
  2078. EXEC sp_addextendedproperty
  2079. 'MS_Description', N'主键',
  2080. 'SCHEMA', N'dbo',
  2081. 'TABLE', N'sj_workflow',
  2082. 'COLUMN', N'id'
  2083. GO
  2084. EXEC sp_addextendedproperty
  2085. 'MS_Description', N'工作流名称',
  2086. 'SCHEMA', N'dbo',
  2087. 'TABLE', N'sj_workflow',
  2088. 'COLUMN', N'workflow_name'
  2089. GO
  2090. EXEC sp_addextendedproperty
  2091. 'MS_Description', N'命名空间id',
  2092. 'SCHEMA', N'dbo',
  2093. 'TABLE', N'sj_workflow',
  2094. 'COLUMN', N'namespace_id'
  2095. GO
  2096. EXEC sp_addextendedproperty
  2097. 'MS_Description', N'组名称',
  2098. 'SCHEMA', N'dbo',
  2099. 'TABLE', N'sj_workflow',
  2100. 'COLUMN', N'group_name'
  2101. GO
  2102. EXEC sp_addextendedproperty
  2103. 'MS_Description', N'工作流状态 0、关闭、1、开启',
  2104. 'SCHEMA', N'dbo',
  2105. 'TABLE', N'sj_workflow',
  2106. 'COLUMN', N'workflow_status'
  2107. GO
  2108. EXEC sp_addextendedproperty
  2109. 'MS_Description', N'触发类型 1.CRON 表达式 2. 固定时间',
  2110. 'SCHEMA', N'dbo',
  2111. 'TABLE', N'sj_workflow',
  2112. 'COLUMN', N'trigger_type'
  2113. GO
  2114. EXEC sp_addextendedproperty
  2115. 'MS_Description', N'间隔时长',
  2116. 'SCHEMA', N'dbo',
  2117. 'TABLE', N'sj_workflow',
  2118. 'COLUMN', N'trigger_interval'
  2119. GO
  2120. EXEC sp_addextendedproperty
  2121. 'MS_Description', N'下次触发时间',
  2122. 'SCHEMA', N'dbo',
  2123. 'TABLE', N'sj_workflow',
  2124. 'COLUMN', N'next_trigger_at'
  2125. GO
  2126. EXEC sp_addextendedproperty
  2127. 'MS_Description', N'阻塞策略 1、丢弃 2、覆盖 3、并行',
  2128. 'SCHEMA', N'dbo',
  2129. 'TABLE', N'sj_workflow',
  2130. 'COLUMN', N'block_strategy'
  2131. GO
  2132. EXEC sp_addextendedproperty
  2133. 'MS_Description', N'任务执行超时时间,单位秒',
  2134. 'SCHEMA', N'dbo',
  2135. 'TABLE', N'sj_workflow',
  2136. 'COLUMN', N'executor_timeout'
  2137. GO
  2138. EXEC sp_addextendedproperty
  2139. 'MS_Description', N'描述',
  2140. 'SCHEMA', N'dbo',
  2141. 'TABLE', N'sj_workflow',
  2142. 'COLUMN', N'description'
  2143. GO
  2144. EXEC sp_addextendedproperty
  2145. 'MS_Description', N'流程信息',
  2146. 'SCHEMA', N'dbo',
  2147. 'TABLE', N'sj_workflow',
  2148. 'COLUMN', N'flow_info'
  2149. GO
  2150. EXEC sp_addextendedproperty
  2151. 'MS_Description', N'上下文',
  2152. 'SCHEMA', N'dbo',
  2153. 'TABLE', N'sj_workflow',
  2154. 'COLUMN', N'wf_context'
  2155. GO
  2156. EXEC sp_addextendedproperty
  2157. 'MS_Description', N'通知告警场景配置id列表',
  2158. 'SCHEMA', N'dbo',
  2159. 'TABLE', N'sj_workflow',
  2160. 'COLUMN', N'notify_ids'
  2161. GO
  2162. EXEC sp_addextendedproperty
  2163. 'MS_Description', N'bucket',
  2164. 'SCHEMA', N'dbo',
  2165. 'TABLE', N'sj_workflow',
  2166. 'COLUMN', N'bucket_index'
  2167. GO
  2168. EXEC sp_addextendedproperty
  2169. 'MS_Description', N'版本号',
  2170. 'SCHEMA', N'dbo',
  2171. 'TABLE', N'sj_workflow',
  2172. 'COLUMN', N'version'
  2173. GO
  2174. EXEC sp_addextendedproperty
  2175. 'MS_Description', N'扩展字段',
  2176. 'SCHEMA', N'dbo',
  2177. 'TABLE', N'sj_workflow',
  2178. 'COLUMN', N'ext_attrs'
  2179. GO
  2180. EXEC sp_addextendedproperty
  2181. 'MS_Description', N'逻辑删除 1、删除',
  2182. 'SCHEMA', N'dbo',
  2183. 'TABLE', N'sj_workflow',
  2184. 'COLUMN', N'deleted'
  2185. GO
  2186. EXEC sp_addextendedproperty
  2187. 'MS_Description', N'创建时间',
  2188. 'SCHEMA', N'dbo',
  2189. 'TABLE', N'sj_workflow',
  2190. 'COLUMN', N'create_dt'
  2191. GO
  2192. EXEC sp_addextendedproperty
  2193. 'MS_Description', N'修改时间',
  2194. 'SCHEMA', N'dbo',
  2195. 'TABLE', N'sj_workflow',
  2196. 'COLUMN', N'update_dt'
  2197. GO
  2198. EXEC sp_addextendedproperty
  2199. 'MS_Description', N'工作流',
  2200. 'SCHEMA', N'dbo',
  2201. 'TABLE', N'sj_workflow'
  2202. GO
  2203. -- sj_workflow_node
  2204. CREATE TABLE sj_workflow_node
  2205. (
  2206. id bigint NOT NULL PRIMARY KEY IDENTITY,
  2207. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  2208. node_name nvarchar(64) NOT NULL,
  2209. group_name nvarchar(64) NOT NULL,
  2210. job_id bigint NOT NULL,
  2211. workflow_id bigint NOT NULL,
  2212. node_type tinyint NOT NULL DEFAULT 1,
  2213. expression_type tinyint NOT NULL DEFAULT 0,
  2214. fail_strategy tinyint NOT NULL DEFAULT 1,
  2215. workflow_node_status tinyint NOT NULL DEFAULT 1,
  2216. priority_level int NOT NULL DEFAULT 1,
  2217. node_info nvarchar(max) NULL DEFAULT NULL,
  2218. version int NOT NULL,
  2219. ext_attrs nvarchar(256) NULL DEFAULT '',
  2220. deleted tinyint NOT NULL DEFAULT 0,
  2221. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  2222. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  2223. )
  2224. GO
  2225. CREATE INDEX idx_sj_workflow_node_01 ON sj_workflow_node (create_dt)
  2226. GO
  2227. CREATE INDEX idx_sj_workflow_node_02 ON sj_workflow_node (namespace_id, group_name)
  2228. GO
  2229. EXEC sp_addextendedproperty
  2230. 'MS_Description', N'主键',
  2231. 'SCHEMA', N'dbo',
  2232. 'TABLE', N'sj_workflow_node',
  2233. 'COLUMN', N'id'
  2234. GO
  2235. EXEC sp_addextendedproperty
  2236. 'MS_Description', N'命名空间id',
  2237. 'SCHEMA', N'dbo',
  2238. 'TABLE', N'sj_workflow_node',
  2239. 'COLUMN', N'namespace_id'
  2240. GO
  2241. EXEC sp_addextendedproperty
  2242. 'MS_Description', N'节点名称',
  2243. 'SCHEMA', N'dbo',
  2244. 'TABLE', N'sj_workflow_node',
  2245. 'COLUMN', N'node_name'
  2246. GO
  2247. EXEC sp_addextendedproperty
  2248. 'MS_Description', N'组名称',
  2249. 'SCHEMA', N'dbo',
  2250. 'TABLE', N'sj_workflow_node',
  2251. 'COLUMN', N'group_name'
  2252. GO
  2253. EXEC sp_addextendedproperty
  2254. 'MS_Description', N'任务信息id',
  2255. 'SCHEMA', N'dbo',
  2256. 'TABLE', N'sj_workflow_node',
  2257. 'COLUMN', N'job_id'
  2258. GO
  2259. EXEC sp_addextendedproperty
  2260. 'MS_Description', N'工作流ID',
  2261. 'SCHEMA', N'dbo',
  2262. 'TABLE', N'sj_workflow_node',
  2263. 'COLUMN', N'workflow_id'
  2264. GO
  2265. EXEC sp_addextendedproperty
  2266. 'MS_Description', N'1、任务节点 2、条件节点',
  2267. 'SCHEMA', N'dbo',
  2268. 'TABLE', N'sj_workflow_node',
  2269. 'COLUMN', N'node_type'
  2270. GO
  2271. EXEC sp_addextendedproperty
  2272. 'MS_Description', N'1、SpEl、2、Aviator 3、QL',
  2273. 'SCHEMA', N'dbo',
  2274. 'TABLE', N'sj_workflow_node',
  2275. 'COLUMN', N'expression_type'
  2276. GO
  2277. EXEC sp_addextendedproperty
  2278. 'MS_Description', N'失败策略 1、跳过 2、阻塞',
  2279. 'SCHEMA', N'dbo',
  2280. 'TABLE', N'sj_workflow_node',
  2281. 'COLUMN', N'fail_strategy'
  2282. GO
  2283. EXEC sp_addextendedproperty
  2284. 'MS_Description', N'工作流节点状态 0、关闭、1、开启',
  2285. 'SCHEMA', N'dbo',
  2286. 'TABLE', N'sj_workflow_node',
  2287. 'COLUMN', N'workflow_node_status'
  2288. GO
  2289. EXEC sp_addextendedproperty
  2290. 'MS_Description', N'优先级',
  2291. 'SCHEMA', N'dbo',
  2292. 'TABLE', N'sj_workflow_node',
  2293. 'COLUMN', N'priority_level'
  2294. GO
  2295. EXEC sp_addextendedproperty
  2296. 'MS_Description', N'节点信息 ',
  2297. 'SCHEMA', N'dbo',
  2298. 'TABLE', N'sj_workflow_node',
  2299. 'COLUMN', N'node_info'
  2300. GO
  2301. EXEC sp_addextendedproperty
  2302. 'MS_Description', N'版本号',
  2303. 'SCHEMA', N'dbo',
  2304. 'TABLE', N'sj_workflow_node',
  2305. 'COLUMN', N'version'
  2306. GO
  2307. EXEC sp_addextendedproperty
  2308. 'MS_Description', N'扩展字段',
  2309. 'SCHEMA', N'dbo',
  2310. 'TABLE', N'sj_workflow_node',
  2311. 'COLUMN', N'ext_attrs'
  2312. GO
  2313. EXEC sp_addextendedproperty
  2314. 'MS_Description', N'逻辑删除 1、删除',
  2315. 'SCHEMA', N'dbo',
  2316. 'TABLE', N'sj_workflow_node',
  2317. 'COLUMN', N'deleted'
  2318. GO
  2319. EXEC sp_addextendedproperty
  2320. 'MS_Description', N'创建时间',
  2321. 'SCHEMA', N'dbo',
  2322. 'TABLE', N'sj_workflow_node',
  2323. 'COLUMN', N'create_dt'
  2324. GO
  2325. EXEC sp_addextendedproperty
  2326. 'MS_Description', N'修改时间',
  2327. 'SCHEMA', N'dbo',
  2328. 'TABLE', N'sj_workflow_node',
  2329. 'COLUMN', N'update_dt'
  2330. GO
  2331. EXEC sp_addextendedproperty
  2332. 'MS_Description', N'工作流节点',
  2333. 'SCHEMA', N'dbo',
  2334. 'TABLE', N'sj_workflow_node'
  2335. GO
  2336. -- sj_workflow_task_batch
  2337. CREATE TABLE sj_workflow_task_batch
  2338. (
  2339. id bigint NOT NULL PRIMARY KEY IDENTITY,
  2340. namespace_id nvarchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
  2341. group_name nvarchar(64) NOT NULL,
  2342. workflow_id bigint NOT NULL,
  2343. task_batch_status tinyint NOT NULL DEFAULT 0,
  2344. operation_reason tinyint NOT NULL DEFAULT 0,
  2345. flow_info nvarchar(max) NULL DEFAULT NULL,
  2346. wf_context nvarchar(max) NULL DEFAULT NULL,
  2347. execution_at bigint NOT NULL DEFAULT 0,
  2348. ext_attrs nvarchar(256) NULL DEFAULT '',
  2349. version int NOT NULL DEFAULT 1,
  2350. deleted tinyint NOT NULL DEFAULT 0,
  2351. create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  2352. update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
  2353. )
  2354. GO
  2355. CREATE INDEX idx_sj_workflow_task_batch_01 ON sj_workflow_task_batch (workflow_id, task_batch_status)
  2356. GO
  2357. CREATE INDEX idx_sj_workflow_task_batch_02 ON sj_workflow_task_batch (create_dt)
  2358. GO
  2359. CREATE INDEX idx_sj_workflow_task_batch_03 ON sj_workflow_task_batch (namespace_id, group_name)
  2360. GO
  2361. EXEC sp_addextendedproperty
  2362. 'MS_Description', N'主键',
  2363. 'SCHEMA', N'dbo',
  2364. 'TABLE', N'sj_workflow_task_batch',
  2365. 'COLUMN', N'id'
  2366. GO
  2367. EXEC sp_addextendedproperty
  2368. 'MS_Description', N'命名空间id',
  2369. 'SCHEMA', N'dbo',
  2370. 'TABLE', N'sj_workflow_task_batch',
  2371. 'COLUMN', N'namespace_id'
  2372. GO
  2373. EXEC sp_addextendedproperty
  2374. 'MS_Description', N'组名称',
  2375. 'SCHEMA', N'dbo',
  2376. 'TABLE', N'sj_workflow_task_batch',
  2377. 'COLUMN', N'group_name'
  2378. GO
  2379. EXEC sp_addextendedproperty
  2380. 'MS_Description', N'工作流任务id',
  2381. 'SCHEMA', N'dbo',
  2382. 'TABLE', N'sj_workflow_task_batch',
  2383. 'COLUMN', N'workflow_id'
  2384. GO
  2385. EXEC sp_addextendedproperty
  2386. 'MS_Description', N'任务批次状态 0、失败 1、成功',
  2387. 'SCHEMA', N'dbo',
  2388. 'TABLE', N'sj_workflow_task_batch',
  2389. 'COLUMN', N'task_batch_status'
  2390. GO
  2391. EXEC sp_addextendedproperty
  2392. 'MS_Description', N'操作原因',
  2393. 'SCHEMA', N'dbo',
  2394. 'TABLE', N'sj_workflow_task_batch',
  2395. 'COLUMN', N'operation_reason'
  2396. GO
  2397. EXEC sp_addextendedproperty
  2398. 'MS_Description', N'流程信息',
  2399. 'SCHEMA', N'dbo',
  2400. 'TABLE', N'sj_workflow_task_batch',
  2401. 'COLUMN', N'flow_info'
  2402. GO
  2403. EXEC sp_addextendedproperty
  2404. 'MS_Description', N'全局上下文',
  2405. 'SCHEMA', N'dbo',
  2406. 'TABLE', N'sj_workflow_task_batch',
  2407. 'COLUMN', N'wf_context'
  2408. GO
  2409. EXEC sp_addextendedproperty
  2410. 'MS_Description', N'任务执行时间',
  2411. 'SCHEMA', N'dbo',
  2412. 'TABLE', N'sj_workflow_task_batch',
  2413. 'COLUMN', N'execution_at'
  2414. GO
  2415. EXEC sp_addextendedproperty
  2416. 'MS_Description', N'扩展字段',
  2417. 'SCHEMA', N'dbo',
  2418. 'TABLE', N'sj_workflow_task_batch',
  2419. 'COLUMN', N'ext_attrs'
  2420. GO
  2421. EXEC sp_addextendedproperty
  2422. 'MS_Description', N'版本号',
  2423. 'SCHEMA', N'dbo',
  2424. 'TABLE', N'sj_workflow_task_batch',
  2425. 'COLUMN', N'version'
  2426. GO
  2427. EXEC sp_addextendedproperty
  2428. 'MS_Description', N'逻辑删除 1、删除',
  2429. 'SCHEMA', N'dbo',
  2430. 'TABLE', N'sj_workflow_task_batch',
  2431. 'COLUMN', N'deleted'
  2432. GO
  2433. EXEC sp_addextendedproperty
  2434. 'MS_Description', N'创建时间',
  2435. 'SCHEMA', N'dbo',
  2436. 'TABLE', N'sj_workflow_task_batch',
  2437. 'COLUMN', N'create_dt'
  2438. GO
  2439. EXEC sp_addextendedproperty
  2440. 'MS_Description', N'修改时间',
  2441. 'SCHEMA', N'dbo',
  2442. 'TABLE', N'sj_workflow_task_batch',
  2443. 'COLUMN', N'update_dt'
  2444. GO
  2445. EXEC sp_addextendedproperty
  2446. 'MS_Description', N'工作流批次',
  2447. 'SCHEMA', N'dbo',
  2448. 'TABLE', N'sj_workflow_task_batch'
  2449. GO