No Description

postgres_ry_workflow.sql 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. -- 请假单信息
  2. create table test_leave
  3. (
  4. id bigint not null
  5. constraint test_leave_pk
  6. primary key,
  7. leave_type varchar(255),
  8. start_date timestamp,
  9. end_date timestamp,
  10. leave_days bigint,
  11. remark varchar(255),
  12. status varchar(255),
  13. create_dept bigint,
  14. create_by bigint,
  15. create_time timestamp,
  16. update_by bigint,
  17. update_time timestamp,
  18. tenant_id varchar(20)
  19. );
  20. comment on table test_leave is '请假申请表';
  21. comment on column test_leave.id is '主键';
  22. comment on column test_leave.leave_type is '请假类型';
  23. comment on column test_leave.start_date is '开始时间';
  24. comment on column test_leave.end_date is '结束时间';
  25. comment on column test_leave.remark is '请假原因';
  26. comment on column test_leave.status is '状态';
  27. comment on column test_leave.create_dept is '创建部门';
  28. comment on column test_leave.create_by is '创建者';
  29. comment on column test_leave.create_time is '创建时间';
  30. comment on column test_leave.update_by is '更新者';
  31. comment on column test_leave.update_time is '更新时间';
  32. comment on column test_leave.tenant_id is '租户编码';
  33. alter table test_leave
  34. owner to postgres;
  35. -- 流程分类信息表
  36. create table wf_category
  37. (
  38. id bigint not null
  39. constraint wf_category_pk
  40. primary key,
  41. category_name varchar(255),
  42. category_code varchar(255),
  43. parent_id bigint,
  44. sort_num bigint,
  45. tenant_id varchar(20),
  46. create_dept bigint,
  47. create_by bigint,
  48. create_time timestamp,
  49. update_by bigint,
  50. update_time timestamp
  51. );
  52. comment on table wf_category is '流程分类';
  53. comment on column wf_category.id is '主键';
  54. comment on column wf_category.category_name is '分类名称';
  55. comment on column wf_category.category_code is '分类编码';
  56. comment on column wf_category.parent_id is '父级id';
  57. comment on column wf_category.sort_num is '排序';
  58. comment on column wf_category.tenant_id is '租户id';
  59. comment on column wf_category.create_dept is '创建部门';
  60. comment on column wf_category.create_by is '创建者';
  61. comment on column wf_category.create_time is '创建时间';
  62. comment on column wf_category.update_by is '修改者';
  63. comment on column wf_category.update_time is '修改时间';
  64. alter table wf_category
  65. owner to postgres;
  66. create unique index uni_category_code
  67. on wf_category (category_code);
  68. INSERT INTO wf_category values (1, 'OA', 'OA', 0, 0, '000000', 103, 1, now(), 1, now());
  69. create table wf_task_back_node
  70. (
  71. id bigint not null
  72. constraint pk_wf_task_back_node
  73. primary key,
  74. node_id varchar(255) not null,
  75. node_name varchar(255) not null,
  76. order_no bigint not null,
  77. instance_id varchar(255) not null,
  78. task_type varchar(255) not null,
  79. assignee varchar(2000) not null,
  80. tenant_id varchar(20),
  81. create_dept bigint,
  82. create_by bigint,
  83. create_time timestamp,
  84. update_by bigint,
  85. update_time timestamp
  86. );
  87. comment on table wf_task_back_node is '节点审批记录';
  88. comment on column wf_task_back_node.id is '主键';
  89. comment on column wf_task_back_node.node_id is '节点id';
  90. comment on column wf_task_back_node.node_name is '节点名称';
  91. comment on column wf_task_back_node.order_no is '排序';
  92. comment on column wf_task_back_node.instance_id is '流程实例id';
  93. comment on column wf_task_back_node.task_type is '节点类型';
  94. comment on column wf_task_back_node.assignee is '审批人';
  95. comment on column wf_task_back_node.tenant_id is '租户id';
  96. comment on column wf_task_back_node.create_dept is '创建部门';
  97. comment on column wf_task_back_node.create_by is '创建者';
  98. comment on column wf_task_back_node.create_time is '创建时间';
  99. comment on column wf_task_back_node.update_by is '修改者';
  100. comment on column wf_task_back_node.update_time is '修改时间';
  101. alter table wf_task_back_node
  102. owner to postgres;
  103. create table wf_definition_config
  104. (
  105. id bigint not null
  106. constraint pk_wf_definition_config
  107. primary key,
  108. table_name varchar(255) not null,
  109. definition_id varchar(255) not null,
  110. process_key varchar(255) not null,
  111. version bigint not null,
  112. tenant_id varchar(20),
  113. remark varchar(500),
  114. create_dept bigint,
  115. create_by bigint,
  116. create_time timestamp,
  117. update_by bigint,
  118. update_time timestamp
  119. );
  120. comment on table wf_definition_config is '流程定义配置';
  121. comment on column wf_definition_config.id is '主键';
  122. comment on column wf_definition_config.table_name is '表名';
  123. comment on column wf_definition_config.definition_id is '流程定义ID';
  124. comment on column wf_definition_config.process_key is '流程KEY';
  125. comment on column wf_definition_config.version is '流程版本';
  126. comment on column wf_definition_config.tenant_id is '租户id';
  127. comment on column wf_definition_config.remark is '备注';
  128. comment on column wf_definition_config.create_dept is '创建部门';
  129. comment on column wf_definition_config.create_by is '创建者';
  130. comment on column wf_definition_config.create_time is '创建时间';
  131. comment on column wf_definition_config.update_by is '修改者';
  132. comment on column wf_definition_config.update_time is '修改时间';
  133. alter table wf_definition_config
  134. owner to postgres;
  135. create unique index uni_definition_id
  136. on wf_definition_config (definition_id);
  137. create table wf_form_manage
  138. (
  139. id bigint not null
  140. constraint pk_wf_form_manage
  141. primary key,
  142. form_name varchar(255) not null,
  143. form_type varchar(255) not null,
  144. router varchar(255) not null,
  145. remark varchar(500),
  146. tenant_id varchar(20),
  147. create_dept bigint,
  148. create_by bigint,
  149. create_time timestamp,
  150. update_by bigint,
  151. update_time timestamp
  152. );
  153. comment on table wf_form_manage is '表单管理';
  154. comment on column wf_form_manage.id is '主键';
  155. comment on column wf_form_manage.form_name is '表单名称';
  156. comment on column wf_form_manage.form_type is '表单类型';
  157. comment on column wf_form_manage.router is '路由地址/表单ID';
  158. comment on column wf_form_manage.remark is '备注';
  159. comment on column wf_form_manage.tenant_id is '租户id';
  160. comment on column wf_form_manage.create_dept is '创建部门';
  161. comment on column wf_form_manage.create_by is '创建者';
  162. comment on column wf_form_manage.create_time is '创建时间';
  163. comment on column wf_form_manage.update_by is '修改者';
  164. comment on column wf_form_manage.update_time is '修改时间';
  165. insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/workflow/leaveEdit/index', NULL, '000000', 103, 1, now(), 1, now());
  166. create table wf_node_config
  167. (
  168. id bigint not null
  169. constraint pk_wf_node_config
  170. primary key,
  171. form_id bigint,
  172. form_type varchar(255),
  173. node_name varchar(255) not null,
  174. node_id varchar(255) not null,
  175. definition_id varchar(255) not null,
  176. apply_user_task char(1) default '0',
  177. tenant_id varchar(20),
  178. create_dept bigint,
  179. create_by bigint,
  180. create_time timestamp,
  181. update_by bigint,
  182. update_time timestamp
  183. );
  184. comment on table wf_node_config is '节点配置';
  185. comment on column wf_node_config.id is '主键';
  186. comment on column wf_node_config.form_id is '表单id';
  187. comment on column wf_node_config.form_type is '表单类型';
  188. comment on column wf_node_config.node_id is '节点id';
  189. comment on column wf_node_config.node_name is '节点名称';
  190. comment on column wf_node_config.definition_id is '流程定义id';
  191. comment on column wf_node_config.apply_user_task is '是否为申请人节点 (0是 1否)';
  192. comment on column wf_node_config.tenant_id is '租户id';
  193. comment on column wf_node_config.create_dept is '创建部门';
  194. comment on column wf_node_config.create_by is '创建者';
  195. comment on column wf_node_config.create_time is '创建时间';
  196. comment on column wf_node_config.update_by is '修改者';
  197. comment on column wf_node_config.update_time is '修改时间';