flowlong-postgresql.sql 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. -- ----------------------------
  2. -- Table structure for flw_his_task_actor
  3. -- ----------------------------
  4. DROP TABLE IF EXISTS "public"."flw_his_task_actor";
  5. CREATE TABLE "public"."flw_his_task_actor" (
  6. "id" int8 NOT NULL,
  7. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  8. "instance_id" int8 NOT NULL,
  9. "task_id" int8 NOT NULL,
  10. "actor_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  11. "actor_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  12. "actor_type" int4 NOT NULL,
  13. "weight" int4
  14. )
  15. ;
  16. COMMENT ON COLUMN "public"."flw_his_task_actor"."id" IS '主键 ID';
  17. COMMENT ON COLUMN "public"."flw_his_task_actor"."tenant_id" IS '租户ID';
  18. COMMENT ON COLUMN "public"."flw_his_task_actor"."instance_id" IS '流程实例ID';
  19. COMMENT ON COLUMN "public"."flw_his_task_actor"."task_id" IS '任务ID';
  20. COMMENT ON COLUMN "public"."flw_his_task_actor"."actor_id" IS '参与者ID';
  21. COMMENT ON COLUMN "public"."flw_his_task_actor"."actor_name" IS '参与者名称';
  22. COMMENT ON COLUMN "public"."flw_his_task_actor"."actor_type" IS '参与者类型 0,用户 1,角色 2,部门';
  23. COMMENT ON COLUMN "public"."flw_his_task_actor"."weight" IS '票签权重';
  24. COMMENT ON TABLE "public"."flw_his_task_actor" IS '历史任务参与者表';
  25. -- ----------------------------
  26. -- Table structure for flw_his_task
  27. -- ----------------------------
  28. DROP TABLE IF EXISTS "public"."flw_his_task";
  29. CREATE TABLE "public"."flw_his_task" (
  30. "id" int8 NOT NULL,
  31. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  32. "create_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  33. "create_by" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  34. "create_time" timestamp(6) NOT NULL,
  35. "instance_id" int8 NOT NULL,
  36. "parent_task_id" int8,
  37. "call_process_id" int8,
  38. "call_instance_id" int8,
  39. "task_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  40. "display_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  41. "task_type" int2 NOT NULL,
  42. "perform_type" int2,
  43. "action_url" varchar(200) COLLATE "pg_catalog"."default",
  44. "variable" text COLLATE "pg_catalog"."default",
  45. "assignor_id" varchar(100) COLLATE "pg_catalog"."default",
  46. "assignor" varchar(100) COLLATE "pg_catalog"."default",
  47. "expire_time" timestamp(6),
  48. "remind_time" timestamp(6),
  49. "remind_repeat" int2 NOT NULL DEFAULT 0,
  50. "viewed" int2 NOT NULL DEFAULT 0,
  51. "finish_time" timestamp(6),
  52. "task_state" int2 NOT NULL DEFAULT 0,
  53. "duration" int8
  54. )
  55. ;
  56. COMMENT ON COLUMN "public"."flw_his_task"."id" IS '主键ID';
  57. COMMENT ON COLUMN "public"."flw_his_task"."tenant_id" IS '租户ID';
  58. COMMENT ON COLUMN "public"."flw_his_task"."create_id" IS '创建人ID';
  59. COMMENT ON COLUMN "public"."flw_his_task"."create_by" IS '创建人名称';
  60. COMMENT ON COLUMN "public"."flw_his_task"."create_time" IS '创建时间';
  61. COMMENT ON COLUMN "public"."flw_his_task"."instance_id" IS '流程实例ID';
  62. COMMENT ON COLUMN "public"."flw_his_task"."parent_task_id" IS '父任务ID';
  63. COMMENT ON COLUMN "public"."flw_his_task"."call_process_id" IS '调用外部流程定义ID';
  64. COMMENT ON COLUMN "public"."flw_his_task"."call_instance_id" IS '调用外部流程实例ID';
  65. COMMENT ON COLUMN "public"."flw_his_task"."task_name" IS '任务名称';
  66. COMMENT ON COLUMN "public"."flw_his_task"."display_name" IS '任务显示名称';
  67. COMMENT ON COLUMN "public"."flw_his_task"."task_type" IS '任务类型';
  68. COMMENT ON COLUMN "public"."flw_his_task"."perform_type" IS '参与类型';
  69. COMMENT ON COLUMN "public"."flw_his_task"."action_url" IS '任务处理的url';
  70. COMMENT ON COLUMN "public"."flw_his_task"."variable" IS '变量json';
  71. COMMENT ON COLUMN "public"."flw_his_task"."assignor_id" IS '委托人ID';
  72. COMMENT ON COLUMN "public"."flw_his_task"."assignor" IS '委托人';
  73. COMMENT ON COLUMN "public"."flw_his_task"."expire_time" IS '任务期望完成时间';
  74. COMMENT ON COLUMN "public"."flw_his_task"."remind_time" IS '提醒时间';
  75. COMMENT ON COLUMN "public"."flw_his_task"."remind_repeat" IS '提醒次数';
  76. COMMENT ON COLUMN "public"."flw_his_task"."viewed" IS '已阅 0,否 1,是';
  77. COMMENT ON COLUMN "public"."flw_his_task"."finish_time" IS '任务完成时间';
  78. COMMENT ON COLUMN "public"."flw_his_task"."task_state" IS '任务状态 0,活动 1,结束 2,拒绝 3,超时 4,终止 5,跳转';
  79. COMMENT ON COLUMN "public"."flw_his_task"."duration" IS '处理耗时';
  80. COMMENT ON TABLE "public"."flw_his_task" IS '历史任务表';
  81. -- ----------------------------
  82. -- Table structure for flw_task_actor
  83. -- ----------------------------
  84. DROP TABLE IF EXISTS "public"."flw_task_actor";
  85. CREATE TABLE "public"."flw_task_actor" (
  86. "id" int8 NOT NULL,
  87. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  88. "instance_id" int8 NOT NULL,
  89. "task_id" int8 NOT NULL,
  90. "actor_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  91. "actor_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  92. "actor_type" int4 NOT NULL,
  93. "weight" int4
  94. )
  95. ;
  96. COMMENT ON COLUMN "public"."flw_task_actor"."id" IS '主键 ID';
  97. COMMENT ON COLUMN "public"."flw_task_actor"."tenant_id" IS '租户ID';
  98. COMMENT ON COLUMN "public"."flw_task_actor"."instance_id" IS '流程实例ID';
  99. COMMENT ON COLUMN "public"."flw_task_actor"."task_id" IS '任务ID';
  100. COMMENT ON COLUMN "public"."flw_task_actor"."actor_id" IS '参与者ID';
  101. COMMENT ON COLUMN "public"."flw_task_actor"."actor_name" IS '参与者名称';
  102. COMMENT ON COLUMN "public"."flw_task_actor"."actor_type" IS '参与者类型 0,用户 1,角色 2,部门';
  103. COMMENT ON COLUMN "public"."flw_task_actor"."weight" IS '票签权重';
  104. COMMENT ON TABLE "public"."flw_task_actor" IS '任务参与者表';
  105. -- ----------------------------
  106. -- Table structure for flw_task
  107. -- ----------------------------
  108. DROP TABLE IF EXISTS "public"."flw_task";
  109. CREATE TABLE "public"."flw_task" (
  110. "id" int8 NOT NULL,
  111. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  112. "create_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  113. "create_by" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  114. "create_time" timestamp(6) NOT NULL,
  115. "instance_id" int8 NOT NULL,
  116. "parent_task_id" int8,
  117. "task_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  118. "display_name" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  119. "task_type" int2 NOT NULL,
  120. "perform_type" int2,
  121. "action_url" varchar(200) COLLATE "pg_catalog"."default",
  122. "variable" text COLLATE "pg_catalog"."default",
  123. "assignor_id" varchar(100) COLLATE "pg_catalog"."default",
  124. "assignor" varchar(100) COLLATE "pg_catalog"."default",
  125. "expire_time" timestamp(6),
  126. "remind_time" timestamp(6),
  127. "remind_repeat" int2 NOT NULL DEFAULT 0,
  128. "viewed" int2 NOT NULL DEFAULT 0
  129. )
  130. ;
  131. COMMENT ON COLUMN "public"."flw_task"."id" IS '主键ID';
  132. COMMENT ON COLUMN "public"."flw_task"."tenant_id" IS '租户ID';
  133. COMMENT ON COLUMN "public"."flw_task"."create_id" IS '创建人ID';
  134. COMMENT ON COLUMN "public"."flw_task"."create_by" IS '创建人名称';
  135. COMMENT ON COLUMN "public"."flw_task"."create_time" IS '创建时间';
  136. COMMENT ON COLUMN "public"."flw_task"."instance_id" IS '流程实例ID';
  137. COMMENT ON COLUMN "public"."flw_task"."parent_task_id" IS '父任务ID';
  138. COMMENT ON COLUMN "public"."flw_task"."task_name" IS '任务名称';
  139. COMMENT ON COLUMN "public"."flw_task"."display_name" IS '任务显示名称';
  140. COMMENT ON COLUMN "public"."flw_task"."task_type" IS '任务类型';
  141. COMMENT ON COLUMN "public"."flw_task"."perform_type" IS '参与类型';
  142. COMMENT ON COLUMN "public"."flw_task"."action_url" IS '任务处理的url';
  143. COMMENT ON COLUMN "public"."flw_task"."variable" IS '变量json';
  144. COMMENT ON COLUMN "public"."flw_task"."assignor_id" IS '委托人ID';
  145. COMMENT ON COLUMN "public"."flw_task"."assignor" IS '委托人';
  146. COMMENT ON COLUMN "public"."flw_task"."expire_time" IS '任务期望完成时间';
  147. COMMENT ON COLUMN "public"."flw_task"."remind_time" IS '提醒时间';
  148. COMMENT ON COLUMN "public"."flw_task"."remind_repeat" IS '提醒次数';
  149. COMMENT ON COLUMN "public"."flw_task"."viewed" IS '已阅 0,否 1,是';
  150. COMMENT ON TABLE "public"."flw_task" IS '任务表';
  151. -- ----------------------------
  152. -- Table structure for flw_ext_instance
  153. -- ----------------------------
  154. DROP TABLE IF EXISTS "public"."flw_ext_instance";
  155. CREATE TABLE "public"."flw_ext_instance" (
  156. "id" int8 NOT NULL,
  157. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  158. "process_id" int8 NOT NULL,
  159. "model_content" text COLLATE "pg_catalog"."default"
  160. )
  161. ;
  162. COMMENT ON COLUMN "public"."flw_ext_instance"."id" IS '主键ID';
  163. COMMENT ON COLUMN "public"."flw_ext_instance"."tenant_id" IS '租户ID';
  164. COMMENT ON COLUMN "public"."flw_ext_instance"."process_id" IS '流程定义ID';
  165. COMMENT ON COLUMN "public"."flw_ext_instance"."model_content" IS '流程模型定义JSON内容';
  166. COMMENT ON TABLE "public"."flw_ext_instance" IS '扩展流程实例表';
  167. -- ----------------------------
  168. -- Table structure for flw_his_instance
  169. -- ----------------------------
  170. DROP TABLE IF EXISTS "public"."flw_his_instance";
  171. CREATE TABLE "public"."flw_his_instance" (
  172. "id" int8 NOT NULL,
  173. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  174. "create_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  175. "create_by" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  176. "create_time" timestamp(6) NOT NULL,
  177. "process_id" int8 NOT NULL,
  178. "parent_instance_id" int8,
  179. "priority" int2,
  180. "instance_no" varchar(50) COLLATE "pg_catalog"."default",
  181. "business_key" varchar(100) COLLATE "pg_catalog"."default",
  182. "variable" text COLLATE "pg_catalog"."default",
  183. "current_node" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  184. "expire_time" timestamp(6),
  185. "last_update_by" varchar(50) COLLATE "pg_catalog"."default",
  186. "last_update_time" timestamp(6),
  187. "instance_state" int2 NOT NULL DEFAULT 0,
  188. "end_time" timestamp(6),
  189. "duration" int8
  190. )
  191. ;
  192. COMMENT ON COLUMN "public"."flw_his_instance"."id" IS '主键ID';
  193. COMMENT ON COLUMN "public"."flw_his_instance"."tenant_id" IS '租户ID';
  194. COMMENT ON COLUMN "public"."flw_his_instance"."create_id" IS '创建人ID';
  195. COMMENT ON COLUMN "public"."flw_his_instance"."create_by" IS '创建人名称';
  196. COMMENT ON COLUMN "public"."flw_his_instance"."create_time" IS '创建时间';
  197. COMMENT ON COLUMN "public"."flw_his_instance"."process_id" IS '流程定义ID';
  198. COMMENT ON COLUMN "public"."flw_his_instance"."parent_instance_id" IS '父流程实例ID';
  199. COMMENT ON COLUMN "public"."flw_his_instance"."priority" IS '优先级';
  200. COMMENT ON COLUMN "public"."flw_his_instance"."instance_no" IS '流程实例编号';
  201. COMMENT ON COLUMN "public"."flw_his_instance"."business_key" IS '业务KEY';
  202. COMMENT ON COLUMN "public"."flw_his_instance"."variable" IS '变量json';
  203. COMMENT ON COLUMN "public"."flw_his_instance"."current_node" IS '当前所在节点';
  204. COMMENT ON COLUMN "public"."flw_his_instance"."expire_time" IS '期望完成时间';
  205. COMMENT ON COLUMN "public"."flw_his_instance"."last_update_by" IS '上次更新人';
  206. COMMENT ON COLUMN "public"."flw_his_instance"."last_update_time" IS '上次更新时间';
  207. COMMENT ON COLUMN "public"."flw_his_instance"."instance_state" IS '状态 0,审批中 1,审批通过 2,审批拒绝 3,撤销审批 4,超时结束 5,强制终止';
  208. COMMENT ON COLUMN "public"."flw_his_instance"."end_time" IS '结束时间';
  209. COMMENT ON COLUMN "public"."flw_his_instance"."duration" IS '处理耗时';
  210. COMMENT ON TABLE "public"."flw_his_instance" IS '历史流程实例表';
  211. -- ----------------------------
  212. -- Table structure for flw_instance
  213. -- ----------------------------
  214. DROP TABLE IF EXISTS "public"."flw_instance";
  215. CREATE TABLE "public"."flw_instance" (
  216. "id" int8 NOT NULL,
  217. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  218. "create_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  219. "create_by" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  220. "create_time" timestamp(6) NOT NULL,
  221. "process_id" int8 NOT NULL,
  222. "parent_instance_id" int8,
  223. "priority" int2,
  224. "instance_no" varchar(50) COLLATE "pg_catalog"."default",
  225. "business_key" varchar(100) COLLATE "pg_catalog"."default",
  226. "variable" text COLLATE "pg_catalog"."default",
  227. "current_node" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  228. "expire_time" timestamp(6),
  229. "last_update_by" varchar(50) COLLATE "pg_catalog"."default",
  230. "last_update_time" timestamp(6)
  231. )
  232. ;
  233. COMMENT ON COLUMN "public"."flw_instance"."id" IS '主键ID';
  234. COMMENT ON COLUMN "public"."flw_instance"."tenant_id" IS '租户ID';
  235. COMMENT ON COLUMN "public"."flw_instance"."create_id" IS '创建人ID';
  236. COMMENT ON COLUMN "public"."flw_instance"."create_by" IS '创建人名称';
  237. COMMENT ON COLUMN "public"."flw_instance"."create_time" IS '创建时间';
  238. COMMENT ON COLUMN "public"."flw_instance"."process_id" IS '流程定义ID';
  239. COMMENT ON COLUMN "public"."flw_instance"."parent_instance_id" IS '父流程实例ID';
  240. COMMENT ON COLUMN "public"."flw_instance"."priority" IS '优先级';
  241. COMMENT ON COLUMN "public"."flw_instance"."instance_no" IS '流程实例编号';
  242. COMMENT ON COLUMN "public"."flw_instance"."business_key" IS '业务KEY';
  243. COMMENT ON COLUMN "public"."flw_instance"."variable" IS '变量json';
  244. COMMENT ON COLUMN "public"."flw_instance"."current_node" IS '当前所在节点';
  245. COMMENT ON COLUMN "public"."flw_instance"."expire_time" IS '期望完成时间';
  246. COMMENT ON COLUMN "public"."flw_instance"."last_update_by" IS '上次更新人';
  247. COMMENT ON COLUMN "public"."flw_instance"."last_update_time" IS '上次更新时间';
  248. COMMENT ON TABLE "public"."flw_instance" IS '流程实例表';
  249. -- ----------------------------
  250. -- Table structure for flw_process
  251. -- ----------------------------
  252. DROP TABLE IF EXISTS "public"."flw_process";
  253. CREATE TABLE "public"."flw_process" (
  254. "id" int8 NOT NULL,
  255. "tenant_id" varchar(50) COLLATE "pg_catalog"."default",
  256. "create_id" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  257. "create_by" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  258. "create_time" timestamp(6) NOT NULL,
  259. "process_key" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  260. "process_name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  261. "process_icon" varchar(255) COLLATE "pg_catalog"."default",
  262. "process_type" varchar(100) COLLATE "pg_catalog"."default",
  263. "process_version" int4 NOT NULL DEFAULT 1,
  264. "instance_url" varchar(200) COLLATE "pg_catalog"."default",
  265. "remark" varchar(255) COLLATE "pg_catalog"."default",
  266. "use_scope" int2 NOT NULL DEFAULT 0,
  267. "process_state" int2 NOT NULL DEFAULT 1,
  268. "model_content" text COLLATE "pg_catalog"."default",
  269. "sort" int2
  270. )
  271. ;
  272. COMMENT ON COLUMN "public"."flw_process"."id" IS '主键ID';
  273. COMMENT ON COLUMN "public"."flw_process"."tenant_id" IS '租户ID';
  274. COMMENT ON COLUMN "public"."flw_process"."create_id" IS '创建人ID';
  275. COMMENT ON COLUMN "public"."flw_process"."create_by" IS '创建人名称';
  276. COMMENT ON COLUMN "public"."flw_process"."create_time" IS '创建时间';
  277. COMMENT ON COLUMN "public"."flw_process"."process_key" IS '流程定义 key 唯一标识';
  278. COMMENT ON COLUMN "public"."flw_process"."process_name" IS '流程定义名称';
  279. COMMENT ON COLUMN "public"."flw_process"."process_icon" IS '流程图标地址';
  280. COMMENT ON COLUMN "public"."flw_process"."process_type" IS '流程类型';
  281. COMMENT ON COLUMN "public"."flw_process"."process_version" IS '流程版本,默认 1';
  282. COMMENT ON COLUMN "public"."flw_process"."instance_url" IS '实例地址';
  283. COMMENT ON COLUMN "public"."flw_process"."remark" IS '备注说明';
  284. COMMENT ON COLUMN "public"."flw_process"."use_scope" IS '使用范围 0,全员 1,指定人员(业务关联) 2,均不可提交';
  285. COMMENT ON COLUMN "public"."flw_process"."process_state" IS '流程状态 0,不可用 1,可用';
  286. COMMENT ON COLUMN "public"."flw_process"."model_content" IS '流程模型定义JSON内容';
  287. COMMENT ON COLUMN "public"."flw_process"."sort" IS '排序';
  288. COMMENT ON TABLE "public"."flw_process" IS '流程定义表';
  289. -- ----------------------------
  290. -- Indexes structure for table flw_his_instance
  291. -- ----------------------------
  292. CREATE INDEX "idx_his_instance_process_id" ON "public"."flw_his_instance" USING btree (
  293. "process_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  294. );
  295. -- ----------------------------
  296. -- Primary Key structure for table flw_his_instance
  297. -- ----------------------------
  298. ALTER TABLE "public"."flw_his_instance" ADD CONSTRAINT "flw_his_instance_pkey" PRIMARY KEY ("id");
  299. -- ----------------------------
  300. -- Indexes structure for table flw_his_task
  301. -- ----------------------------
  302. CREATE INDEX "idx_his_task_instance_id" ON "public"."flw_his_task" USING btree (
  303. "instance_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  304. );
  305. CREATE INDEX "idx_his_task_parent_task_id" ON "public"."flw_his_task" USING btree (
  306. "parent_task_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  307. );
  308. -- ----------------------------
  309. -- Primary Key structure for table flw_his_task
  310. -- ----------------------------
  311. ALTER TABLE "public"."flw_his_task" ADD CONSTRAINT "flw_his_task_pkey" PRIMARY KEY ("id");
  312. -- ----------------------------
  313. -- Indexes structure for table flw_his_task_actor
  314. -- ----------------------------
  315. CREATE INDEX "idx_his_task_actor_task_id" ON "public"."flw_his_task_actor" USING btree (
  316. "task_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  317. );
  318. -- ----------------------------
  319. -- Primary Key structure for table flw_his_task_actor
  320. -- ----------------------------
  321. ALTER TABLE "public"."flw_his_task_actor" ADD CONSTRAINT "flw_his_task_actor_pkey" PRIMARY KEY ("id");
  322. -- ----------------------------
  323. -- Primary Key structure for table flw_ext_instance
  324. -- ----------------------------
  325. ALTER TABLE "public"."flw_ext_instance" ADD CONSTRAINT "flw_ext_instance_pkey" PRIMARY KEY ("id");
  326. -- ----------------------------
  327. -- Foreign Keys structure for table flw_ext_instance
  328. -- ----------------------------
  329. ALTER TABLE "public"."flw_ext_instance" ADD CONSTRAINT "fk_ext_instance_id" FOREIGN KEY ("id") REFERENCES "public"."flw_his_instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
  330. -- ----------------------------
  331. -- Indexes structure for table flw_instance
  332. -- ----------------------------
  333. CREATE INDEX "idx_instance_process_id" ON "public"."flw_instance" USING btree (
  334. "process_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  335. );
  336. -- ----------------------------
  337. -- Primary Key structure for table flw_instance
  338. -- ----------------------------
  339. ALTER TABLE "public"."flw_instance" ADD CONSTRAINT "flw_instance_pkey" PRIMARY KEY ("id");
  340. -- ----------------------------
  341. -- Indexes structure for table flw_process
  342. -- ----------------------------
  343. CREATE INDEX "idx_process_name" ON "public"."flw_process" USING btree (
  344. "process_name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
  345. );
  346. -- ----------------------------
  347. -- Primary Key structure for table flw_process
  348. -- ----------------------------
  349. ALTER TABLE "public"."flw_process" ADD CONSTRAINT "flw_process_pkey" PRIMARY KEY ("id");
  350. -- ----------------------------
  351. -- Indexes structure for table flw_task
  352. -- ----------------------------
  353. CREATE INDEX "idx_task_instance_id" ON "public"."flw_task" USING btree (
  354. "instance_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  355. );
  356. -- ----------------------------
  357. -- Primary Key structure for table flw_task
  358. -- ----------------------------
  359. ALTER TABLE "public"."flw_task" ADD CONSTRAINT "flw_task_pkey" PRIMARY KEY ("id");
  360. -- ----------------------------
  361. -- Indexes structure for table flw_task_actor
  362. -- ----------------------------
  363. CREATE INDEX "idx_task_actor_task_id" ON "public"."flw_task_actor" USING btree (
  364. "task_id" "pg_catalog"."int8_ops" ASC NULLS LAST
  365. );
  366. -- ----------------------------
  367. -- Primary Key structure for table flw_task_actor
  368. -- ----------------------------
  369. ALTER TABLE "public"."flw_task_actor" ADD CONSTRAINT "flw_task_actor_pkey" PRIMARY KEY ("id");
  370. -- ----------------------------
  371. -- Foreign Keys structure for table flw_his_instance
  372. -- ----------------------------
  373. ALTER TABLE "public"."flw_his_instance" ADD CONSTRAINT "flw_his_instance_process_id_fkey" FOREIGN KEY ("process_id") REFERENCES "public"."flw_process" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
  374. -- ----------------------------
  375. -- Foreign Keys structure for table flw_his_task
  376. -- ----------------------------
  377. ALTER TABLE "public"."flw_his_task" ADD CONSTRAINT "flw_his_task_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "public"."flw_his_instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
  378. -- ----------------------------
  379. -- Foreign Keys structure for table flw_his_task_actor
  380. -- ----------------------------
  381. ALTER TABLE "public"."flw_his_task_actor" ADD CONSTRAINT "flw_his_task_actor_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "public"."flw_his_task" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
  382. -- ----------------------------
  383. -- Foreign Keys structure for table flw_instance
  384. -- ----------------------------
  385. ALTER TABLE "public"."flw_instance" ADD CONSTRAINT "flw_instance_process_id_fkey" FOREIGN KEY ("process_id") REFERENCES "public"."flw_process" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
  386. -- ----------------------------
  387. -- Foreign Keys structure for table flw_task
  388. -- ----------------------------
  389. ALTER TABLE "public"."flw_task" ADD CONSTRAINT "flw_task_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "public"."flw_instance" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
  390. -- ----------------------------
  391. -- Foreign Keys structure for table flw_task_actor
  392. -- ----------------------------
  393. ALTER TABLE "public"."flw_task_actor" ADD CONSTRAINT "flw_task_actor_task_id_fkey" FOREIGN KEY ("task_id") REFERENCES "public"."flw_task" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;