powerjob-mysql.sql 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /*
  2. 官方 SQL 仅基于特定版本(MySQL8)导出,不一定兼容其他数据库,也不一定兼容其他版本。此 SQL 仅供参考。
  3. 如果您的数据库无法使用此 SQL,建议使用 SpringDataJPA 自带的建表能力,先在开发环境直连测试库自动建表,然后自行导出相关的 SQL 即可
  4. Navicat Premium Data Transfer
  5. Source Server : Local@3306
  6. Source Server Type : MySQL
  7. Source Server Version : 80300 (8.3.0)
  8. Source Host : localhost:3306
  9. Source Schema : powerjob4
  10. Target Server Type : MySQL
  11. Target Server Version : 80300 (8.3.0)
  12. File Encoding : 65001
  13. Date: 02/03/2024 18:51:36
  14. */
  15. SET NAMES utf8mb4;
  16. SET FOREIGN_KEY_CHECKS = 0;
  17. -- ----------------------------
  18. -- Table structure for app_info
  19. -- ----------------------------
  20. DROP TABLE IF EXISTS `app_info`;
  21. CREATE TABLE `app_info` (
  22. `id` bigint NOT NULL AUTO_INCREMENT,
  23. `app_name` varchar(255) DEFAULT NULL,
  24. `current_server` varchar(255) DEFAULT NULL,
  25. `gmt_create` datetime(6) DEFAULT NULL,
  26. `gmt_modified` datetime(6) DEFAULT NULL,
  27. `password` varchar(255) DEFAULT NULL,
  28. PRIMARY KEY (`id`),
  29. UNIQUE KEY `uidx01_app_info` (`app_name`)
  30. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  31. -- ----------------------------
  32. -- Table structure for container_info
  33. -- ----------------------------
  34. DROP TABLE IF EXISTS `container_info`;
  35. CREATE TABLE `container_info` (
  36. `id` bigint NOT NULL AUTO_INCREMENT,
  37. `app_id` bigint DEFAULT NULL,
  38. `container_name` varchar(255) DEFAULT NULL,
  39. `gmt_create` datetime(6) DEFAULT NULL,
  40. `gmt_modified` datetime(6) DEFAULT NULL,
  41. `last_deploy_time` datetime(6) DEFAULT NULL,
  42. `source_info` varchar(255) DEFAULT NULL,
  43. `source_type` int DEFAULT NULL,
  44. `status` int DEFAULT NULL,
  45. `version` varchar(255) DEFAULT NULL,
  46. PRIMARY KEY (`id`),
  47. KEY `idx01_container_info` (`app_id`)
  48. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  49. -- ----------------------------
  50. -- Table structure for instance_info
  51. -- ----------------------------
  52. DROP TABLE IF EXISTS `instance_info`;
  53. CREATE TABLE `instance_info` (
  54. `id` bigint NOT NULL AUTO_INCREMENT,
  55. `actual_trigger_time` bigint DEFAULT NULL,
  56. `app_id` bigint DEFAULT NULL,
  57. `expected_trigger_time` bigint DEFAULT NULL,
  58. `finished_time` bigint DEFAULT NULL,
  59. `gmt_create` datetime(6) DEFAULT NULL,
  60. `gmt_modified` datetime(6) DEFAULT NULL,
  61. `instance_id` bigint DEFAULT NULL,
  62. `instance_params` longtext,
  63. `job_id` bigint DEFAULT NULL,
  64. `job_params` longtext,
  65. `last_report_time` bigint DEFAULT NULL,
  66. `result` longtext,
  67. `running_times` bigint DEFAULT NULL,
  68. `status` int DEFAULT NULL,
  69. `task_tracker_address` varchar(255) DEFAULT NULL,
  70. `type` int DEFAULT NULL,
  71. `wf_instance_id` bigint DEFAULT NULL,
  72. PRIMARY KEY (`id`),
  73. KEY `idx01_instance_info` (`job_id`,`status`),
  74. KEY `idx02_instance_info` (`app_id`,`status`),
  75. KEY `idx03_instance_info` (`instance_id`,`status`)
  76. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  77. -- ----------------------------
  78. -- Table structure for job_info
  79. -- ----------------------------
  80. DROP TABLE IF EXISTS `job_info`;
  81. CREATE TABLE `job_info` (
  82. `id` bigint NOT NULL AUTO_INCREMENT,
  83. `advanced_runtime_config` varchar(255) DEFAULT NULL,
  84. `alarm_config` varchar(255) DEFAULT NULL,
  85. `app_id` bigint DEFAULT NULL,
  86. `concurrency` int DEFAULT NULL,
  87. `designated_workers` varchar(255) DEFAULT NULL,
  88. `dispatch_strategy` int DEFAULT NULL,
  89. `dispatch_strategy_config` varchar(255) DEFAULT NULL,
  90. `execute_type` int DEFAULT NULL,
  91. `extra` varchar(255) DEFAULT NULL,
  92. `gmt_create` datetime(6) DEFAULT NULL,
  93. `gmt_modified` datetime(6) DEFAULT NULL,
  94. `instance_retry_num` int DEFAULT NULL,
  95. `instance_time_limit` bigint DEFAULT NULL,
  96. `job_description` varchar(255) DEFAULT NULL,
  97. `job_name` varchar(255) DEFAULT NULL,
  98. `job_params` longtext,
  99. `lifecycle` varchar(255) DEFAULT NULL,
  100. `log_config` varchar(255) DEFAULT NULL,
  101. `max_instance_num` int DEFAULT NULL,
  102. `max_worker_count` int DEFAULT NULL,
  103. `min_cpu_cores` double NOT NULL,
  104. `min_disk_space` double NOT NULL,
  105. `min_memory_space` double NOT NULL,
  106. `next_trigger_time` bigint DEFAULT NULL,
  107. `notify_user_ids` varchar(255) DEFAULT NULL,
  108. `processor_info` varchar(255) DEFAULT NULL,
  109. `processor_type` int DEFAULT NULL,
  110. `status` int DEFAULT NULL,
  111. `tag` varchar(255) DEFAULT NULL,
  112. `task_retry_num` int DEFAULT NULL,
  113. `time_expression` varchar(255) DEFAULT NULL,
  114. `time_expression_type` int DEFAULT NULL,
  115. PRIMARY KEY (`id`),
  116. KEY `idx01_job_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`)
  117. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  118. -- ----------------------------
  119. -- Table structure for oms_lock
  120. -- ----------------------------
  121. DROP TABLE IF EXISTS `oms_lock`;
  122. CREATE TABLE `oms_lock` (
  123. `id` bigint NOT NULL AUTO_INCREMENT,
  124. `gmt_create` datetime(6) DEFAULT NULL,
  125. `gmt_modified` datetime(6) DEFAULT NULL,
  126. `lock_name` varchar(255) DEFAULT NULL,
  127. `max_lock_time` bigint DEFAULT NULL,
  128. `ownerip` varchar(255) DEFAULT NULL,
  129. PRIMARY KEY (`id`),
  130. UNIQUE KEY `uidx01_oms_lock` (`lock_name`)
  131. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  132. -- ----------------------------
  133. -- Table structure for server_info
  134. -- ----------------------------
  135. DROP TABLE IF EXISTS `server_info`;
  136. CREATE TABLE `server_info` (
  137. `id` bigint NOT NULL AUTO_INCREMENT,
  138. `gmt_create` datetime(6) DEFAULT NULL,
  139. `gmt_modified` datetime(6) DEFAULT NULL,
  140. `ip` varchar(255) DEFAULT NULL,
  141. PRIMARY KEY (`id`),
  142. UNIQUE KEY `uidx01_server_info` (`ip`),
  143. KEY `idx01_server_info` (`gmt_modified`)
  144. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  145. -- ----------------------------
  146. -- Table structure for user_info
  147. -- ----------------------------
  148. DROP TABLE IF EXISTS `user_info`;
  149. CREATE TABLE `user_info` (
  150. `id` bigint NOT NULL AUTO_INCREMENT,
  151. `email` varchar(255) DEFAULT NULL,
  152. `extra` varchar(255) DEFAULT NULL,
  153. `gmt_create` datetime(6) DEFAULT NULL,
  154. `gmt_modified` datetime(6) DEFAULT NULL,
  155. `password` varchar(255) DEFAULT NULL,
  156. `phone` varchar(255) DEFAULT NULL,
  157. `username` varchar(255) DEFAULT NULL,
  158. `web_hook` varchar(255) DEFAULT NULL,
  159. PRIMARY KEY (`id`),
  160. KEY `uidx01_user_info` (`username`),
  161. KEY `uidx02_user_info` (`email`)
  162. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  163. -- ----------------------------
  164. -- Table structure for workflow_info
  165. -- ----------------------------
  166. DROP TABLE IF EXISTS `workflow_info`;
  167. CREATE TABLE `workflow_info` (
  168. `id` bigint NOT NULL AUTO_INCREMENT,
  169. `app_id` bigint DEFAULT NULL,
  170. `extra` varchar(255) DEFAULT NULL,
  171. `gmt_create` datetime(6) DEFAULT NULL,
  172. `gmt_modified` datetime(6) DEFAULT NULL,
  173. `lifecycle` varchar(255) DEFAULT NULL,
  174. `max_wf_instance_num` int DEFAULT NULL,
  175. `next_trigger_time` bigint DEFAULT NULL,
  176. `notify_user_ids` varchar(255) DEFAULT NULL,
  177. `pedag` longtext,
  178. `status` int DEFAULT NULL,
  179. `time_expression` varchar(255) DEFAULT NULL,
  180. `time_expression_type` int DEFAULT NULL,
  181. `wf_description` varchar(255) DEFAULT NULL,
  182. `wf_name` varchar(255) DEFAULT NULL,
  183. PRIMARY KEY (`id`),
  184. KEY `idx01_workflow_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`)
  185. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  186. -- ----------------------------
  187. -- Table structure for workflow_instance_info
  188. -- ----------------------------
  189. DROP TABLE IF EXISTS `workflow_instance_info`;
  190. CREATE TABLE `workflow_instance_info` (
  191. `id` bigint NOT NULL AUTO_INCREMENT,
  192. `actual_trigger_time` bigint DEFAULT NULL,
  193. `app_id` bigint DEFAULT NULL,
  194. `dag` longtext,
  195. `expected_trigger_time` bigint DEFAULT NULL,
  196. `finished_time` bigint DEFAULT NULL,
  197. `gmt_create` datetime(6) DEFAULT NULL,
  198. `gmt_modified` datetime(6) DEFAULT NULL,
  199. `parent_wf_instance_id` bigint DEFAULT NULL,
  200. `result` longtext,
  201. `status` int DEFAULT NULL,
  202. `wf_context` longtext,
  203. `wf_init_params` longtext,
  204. `wf_instance_id` bigint DEFAULT NULL,
  205. `workflow_id` bigint DEFAULT NULL,
  206. PRIMARY KEY (`id`),
  207. UNIQUE KEY `uidx01_wf_instance` (`wf_instance_id`),
  208. KEY `idx01_wf_instance` (`workflow_id`,`status`,`app_id`,`expected_trigger_time`)
  209. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  210. -- ----------------------------
  211. -- Table structure for workflow_node_info
  212. -- ----------------------------
  213. DROP TABLE IF EXISTS `workflow_node_info`;
  214. CREATE TABLE `workflow_node_info` (
  215. `id` bigint NOT NULL AUTO_INCREMENT,
  216. `app_id` bigint NOT NULL,
  217. `enable` bit(1) NOT NULL,
  218. `extra` longtext,
  219. `gmt_create` datetime(6) NOT NULL,
  220. `gmt_modified` datetime(6) NOT NULL,
  221. `job_id` bigint DEFAULT NULL,
  222. `node_name` varchar(255) DEFAULT NULL,
  223. `node_params` longtext,
  224. `skip_when_failed` bit(1) NOT NULL,
  225. `type` int DEFAULT NULL,
  226. `workflow_id` bigint DEFAULT NULL,
  227. PRIMARY KEY (`id`),
  228. KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`)
  229. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  230. SET FOREIGN_KEY_CHECKS = 1;