JBPM4 sqlserver建表语句

JBPM4没有自带sqlserver的脚本,所以只能自己创建数据表

 

下面是建表语句:
create table JBPM4_DEPLOYMENT ( 
    DBID_ numeric(19,0) not null, 
    NAME_ varchar(255), 
    TIMESTAMP_ numeric(19,0), 
    STATE_ varchar(255), 
    primary key (DBID_) 
); 
create table JBPM4_DEPLOYPROP ( 
    DBID_ numeric(19,0) not null, 
    DEPLOYMENT_ numeric(19,0), 
    OBJNAME_ varchar(255), 
    KEY_ varchar(255), 
    STRINGVAL_ varchar(255), 
    LONGVAL_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_EXECUTION ( 
    DBID_ numeric(19,0) not null, 
    CLASS_ varchar(255) not null, 
    DBVERSION_ numeric(10,0) not null, 
    ACTIVITYNAME_ varchar(255), 
    PROCDEFID_ varchar(255), 
    HASVARS_ numeric(1,0), 
    NAME_ varchar(255), 
    KEY_ varchar(255), 
    ID_ varchar(255) unique, 
    STATE_ varchar(255), 
    SUSPHISTSTATE_ varchar(255), 
    PRIORITY_ numeric(10,0), 
    HISACTINST_ numeric(19,0), 
    PARENT_ numeric(19,0), 
    INSTANCE_ numeric(19,0), 
    SUPEREXEC_ numeric(19,0), 
    SUBPROCINST_ numeric(19,0), 
    PARENT_IDX_ numeric(10,0), 
    primary key (DBID_) 
); 
create table JBPM4_HIST_ACTINST ( 
    DBID_ numeric(19,0) not null, 
    CLASS_ varchar(255) not null, 
    DBVERSION_ numeric(10,0) not null, 
    HPROCI_ numeric(19,0), 
    TYPE_ varchar(255), 
    EXECUTION_ varchar(255), 
    ACTIVITY_NAME_ varchar(255), 
    START_ datetime, 
    END_ datetime, 
    DURATION_ numeric(19,0), 
    TRANSITION_ varchar(255), 
    NEXTIDX_ numeric(10,0), 
    HTASK_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_HIST_DETAIL ( 
    DBID_ numeric(19,0) not null, 
    CLASS_ varchar(255) not null, 
    DBVERSION_ numeric(10,0) not null, 
    USERID_ varchar(255), 
    TIME_ datetime, 
    HPROCI_ numeric(19,0), 
    HPROCIIDX_ numeric(10,0), 
    HACTI_ numeric(19,0), 
    HACTIIDX_ numeric(10,0), 
    HTASK_ numeric(19,0), 
    HTASKIDX_ numeric(10,0), 
    HVAR_ numeric(19,0), 
    HVARIDX_ numeric(10,0), 
    MESSAGE_ varchar(255), 
    OLD_STR_ varchar(255), 
    NEW_STR_ varchar(255), 
    OLD_INT_ numeric(10,0), 
    NEW_INT_ numeric(10,0), 
    OLD_TIME_ datetime, 
    NEW_TIME_ datetime, 
    PARENT_ numeric(19,0), 
    PARENT_IDX_ numeric(10,0), 
    primary key (DBID_) 
); 
create table JBPM4_HIST_PROCINST ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    ID_ varchar(255), 
    PROCDEFID_ varchar(255), 
    KEY_ varchar(255), 
    START_ datetime, 
    END_ datetime, 
    DURATION_ numeric(19,0), 
    STATE_ varchar(255), 
    ENDACTIVITY_ varchar(255), 
    NEXTIDX_ numeric(10,0), 
    primary key (DBID_) 
); 
create table JBPM4_HIST_TASK ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    EXECUTION_ varchar(255), 
    OUTCOME_ varchar(255), 
    ASSIGNEE_ varchar(255), 
    PRIORITY_ numeric(10,0), 
    STATE_ varchar(255), 
    CREATE_ datetime, 
    END_ datetime, 
    DURATION_ numeric(19,0), 
    NEXTIDX_ numeric(10,0), 
    SUPERTASK_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_HIST_VAR ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    PROCINSTID_ varchar(255), 
    EXECUTIONID_ varchar(255), 
    VARNAME_ varchar(255), 
    VALUE_ varchar(255), 
    HPROCI_ numeric(19,0), 
    HTASK_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_ID_GROUP ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    ID_ varchar(255), 
    NAME_ varchar(255), 
    TYPE_ varchar(255), 
    PARENT_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_ID_MEMBERSHIP ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    USER_ numeric(19,0), 
    GROUP_ numeric(19,0), 
    NAME_ varchar(255), 
    primary key (DBID_) 
); 
create table JBPM4_ID_USER ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    ID_ varchar(255), 
    PASSWORD_ varchar(255), 
    GIVENNAME_ varchar(255), 
    FAMILYNAME_ varchar(255), 
    BUSINESSEMAIL_ varchar(255), 
    primary key (DBID_) 
); 
create table JBPM4_JOB ( 
    DBID_ numeric(19,0) not null, 
    CLASS_ varchar(255) not null, 
    DBVERSION_ numeric(10,0) not null, 
    DUEDATE_ datetime, 
    STATE_ varchar(255), 
    ISEXCLUSIVE_ numeric(1,0), 
    LOCKOWNER_ varchar(255), 
    LOCKEXPTIME_ datetime, 
    EXCEPTION_ text, 
    RETRIES_ numeric(10,0), 
    PROCESSINSTANCE_ numeric(19,0), 
    EXECUTION_ numeric(19,0), 
    CFG_ numeric(19,0), 
    SIGNAL_ varchar(255), 
    EVENT_ varchar(255), 
    REPEAT_ varchar(255), 
    primary key (DBID_) 
); 
create table JBPM4_LOB ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    BLOB_VALUE_ image, 
    DEPLOYMENT_ numeric(19,0), 
    NAME_ text, 
    primary key (DBID_) 
); 
create table JBPM4_PARTICIPATION ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    GROUPID_ varchar(255), 
    USERID_ varchar(255), 
    TYPE_ varchar(255), 
    TASK_ numeric(19,0), 
    SWIMLANE_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_PROPERTY ( 
    KEY_ varchar(255) not null, 
    VERSION_ numeric(10,0) not null, 
    VALUE_ varchar(255), 
    primary key (KEY_) 
); 
create table JBPM4_SWIMLANE ( 
    DBID_ numeric(19,0) not null, 
    DBVERSION_ numeric(10,0) not null, 
    NAME_ varchar(255), 
    ASSIGNEE_ varchar(255), 
    EXECUTION_ numeric(19,0), 
    primary key (DBID_) 
); 
create table JBPM4_TASK ( 
    DBID_ numeric(19,0) not null, 
    CLASS_ char(1) not null, 
    DBVERSION_ numeric(10,0) not null, 
    NAME_ varchar(255), 
    DESCR_ text, 
    STATE_ varchar(255), 
    SUSPHISTSTATE_ varchar(255), 
    ASSIGNEE_ varchar(255), 
    FORM_ varchar(255), 
    PRIORITY_ numeric(10,0), 
    CREATE_ datetime, 
    DUEDATE_ datetime, 
    PROGRESS_ numeric(10,0), 
    SIGNALLING_ numeric(1,0), 
    EXECUTION_ID_ varchar(255), 
    ACTIVITY_NAME_ varchar(255), 
    HASVARS_ numeric(1,0), 
    SUPERTASK_ numeric(19,0), 
    EXECUTION_ numeric(19,0), 
    PROCINST_ numeric(19,0), 
    SWIMLANE_ numeric(19,0), 
    TASKDEFNAME_ varchar(255), 
    primary key (DBID_) 
); 
create table JBPM4_VARIABLE ( 
    DBID_ numeric(19,0) not null, 
    CLASS_ varchar(255) not null, 
    DBVERSION_ numeric(10,0) not null, 
    KEY_ varchar(255), 
    CONVERTER_ varchar(255), 
    HIST_ numeric(1,0), 
    EXECUTION_ numeric(19,0), 
    TASK_ numeric(19,0), 
    LOB_ numeric(19,0), 
    DATE_VALUE_ datetime, 
    DOUBLE_VALUE_ double precision, 
    CLASSNAME_ varchar(255), 
    LONG_VALUE_ numeric(19,0), 
    STRING_VALUE_ varchar(255), 
    TEXT_VALUE_ text, 
    EXESYS_ numeric(19,0), 
    primary key (DBID_) 
); 
create index IDX_DEPLPROP_DEPL on JBPM4_DEPLOYPROP (DEPLOYMENT_); 
alter table JBPM4_DEPLOYPROP  
    add constraint FK_DEPLPROP_DEPL  
    foreign key (DEPLOYMENT_)  
    references JBPM4_DEPLOYMENT; 
create index IDX_EXEC_SUPEREXEC on JBPM4_EXECUTION (SUPEREXEC_); 
create index IDX_EXEC_INSTANCE on JBPM4_EXECUTION (INSTANCE_); 
create index IDX_EXEC_SUBPI on JBPM4_EXECUTION (SUBPROCINST_); 
create index IDX_EXEC_PARENT on JBPM4_EXECUTION (PARENT_); 
alter table JBPM4_EXECUTION  
    add constraint FK_EXEC_PARENT  
    foreign key (PARENT_)  
    references JBPM4_EXECUTION; 
alter table JBPM4_EXECUTION  
    add constraint FK_EXEC_SUBPI  
    foreign key (SUBPROCINST_)  
    references JBPM4_EXECUTION; 
alter table JBPM4_EXECUTION  
    add constraint FK_EXEC_INSTANCE  
    foreign key (INSTANCE_)  
    references JBPM4_EXECUTION; 
alter table JBPM4_EXECUTION  
    add constraint FK_EXEC_SUPEREXEC  
    foreign key (SUPEREXEC_)  
    references JBPM4_EXECUTION; 
create index IDX_HACTI_HPROCI on JBPM4_HIST_ACTINST (HPROCI_); 
create index IDX_HTI_HTASK on JBPM4_HIST_ACTINST (HTASK_); 
alter table JBPM4_HIST_ACTINST  
    add constraint FK_HACTI_HPROCI  
    foreign key (HPROCI_)  
    references JBPM4_HIST_PROCINST; 
alter table JBPM4_HIST_ACTINST  
    add constraint FK_HTI_HTASK  
    foreign key (HTASK_)  
    references JBPM4_HIST_TASK; 
create index IDX_HDET_HACTI on JBPM4_HIST_DETAIL (HACTI_); 
create index IDX_HDET_HPROCI on JBPM4_HIST_DETAIL (HPROCI_); 
create index IDX_HDET_HVAR on JBPM4_HIST_DETAIL (HVAR_); 
create index IDX_HDET_HTASK on JBPM4_HIST_DETAIL (HTASK_); 
alter table JBPM4_HIST_DETAIL  
    add constraint FK_HDETAIL_HPROCI  
    foreign key (HPROCI_)  
    references JBPM4_HIST_PROCINST; 
alter table JBPM4_HIST_DETAIL  
    add constraint FK_HDETAIL_HACTI  
    foreign key (HACTI_)  
    references JBPM4_HIST_ACTINST; 
alter table JBPM4_HIST_DETAIL  
    add constraint FK_HDETAIL_HTASK  
    foreign key (HTASK_)  
    references JBPM4_HIST_TASK; 
alter table JBPM4_HIST_DETAIL  
    add constraint FK_HDETAIL_HVAR  
    foreign key (HVAR_)  
    references JBPM4_HIST_VAR; 
create index IDX_HSUPERT_SUB on JBPM4_HIST_TASK (SUPERTASK_); 
alter table JBPM4_HIST_TASK  
    add constraint FK_HSUPERT_SUB  
    foreign key (SUPERTASK_)  
    references JBPM4_HIST_TASK; 
create index IDX_HVAR_HPROCI on JBPM4_HIST_VAR (HPROCI_); 
create index IDX_HVAR_HTASK on JBPM4_HIST_VAR (HTASK_); 
alter table JBPM4_HIST_VAR  
    add constraint FK_HVAR_HPROCI  
    foreign key (HPROCI_)  
    references JBPM4_HIST_PROCINST; 
alter table JBPM4_HIST_VAR  
    add constraint FK_HVAR_HTASK  
    foreign key (HTASK_)  
    references JBPM4_HIST_TASK; 
create index IDX_GROUP_PARENT on JBPM4_ID_GROUP (PARENT_); 
alter table JBPM4_ID_GROUP  
    add constraint FK_GROUP_PARENT  
    foreign key (PARENT_)  
    references JBPM4_ID_GROUP; 
create index IDX_MEM_USER on JBPM4_ID_MEMBERSHIP (USER_); 
create index IDX_MEM_GROUP on JBPM4_ID_MEMBERSHIP (GROUP_); 
alter table JBPM4_ID_MEMBERSHIP  
    add constraint FK_MEM_GROUP  
    foreign key (GROUP_)  
    references JBPM4_ID_GROUP; 
alter table JBPM4_ID_MEMBERSHIP  
    add constraint FK_MEM_USER  
    foreign key (USER_)  
    references JBPM4_ID_USER; 
create index IDX_JOBRETRIES on JBPM4_JOB (RETRIES_); 
create index IDX_JOB_CFG on JBPM4_JOB (CFG_); 
create index IDX_JOB_PRINST on JBPM4_JOB (PROCESSINSTANCE_); 
create index IDX_JOB_EXE on JBPM4_JOB (EXECUTION_); 
create index IDX_JOBLOCKEXP on JBPM4_JOB (LOCKEXPTIME_); 
create index IDX_JOBDUEDATE on JBPM4_JOB (DUEDATE_); 
alter table JBPM4_JOB  
    add constraint FK_JOB_CFG  
    foreign key (CFG_)  
    references JBPM4_LOB; 
create index IDX_LOB_DEPLOYMENT on JBPM4_LOB (DEPLOYMENT_); 
alter table JBPM4_LOB  
    add constraint FK_LOB_DEPLOYMENT  
    foreign key (DEPLOYMENT_)  
    references JBPM4_DEPLOYMENT; 
create index IDX_PART_TASK on JBPM4_PARTICIPATION (TASK_); 
alter table JBPM4_PARTICIPATION  
    add constraint FK_PART_SWIMLANE  
    foreign key (SWIMLANE_)  
    references JBPM4_SWIMLANE; 
alter table JBPM4_PARTICIPATION  
    add constraint FK_PART_TASK  
    foreign key (TASK_)  
    references JBPM4_TASK; 
create index IDX_SWIMLANE_EXEC on JBPM4_SWIMLANE (EXECUTION_); 
alter table JBPM4_SWIMLANE  
    add constraint FK_SWIMLANE_EXEC  
    foreign key (EXECUTION_)  
    references JBPM4_EXECUTION; 
create index IDX_TASK_SUPERTASK on JBPM4_TASK (SUPERTASK_); 
alter table JBPM4_TASK  
    add constraint FK_TASK_SWIML  
    foreign key (SWIMLANE_)  
    references JBPM4_SWIMLANE; 
alter table JBPM4_TASK  
    add constraint FK_TASK_SUPERTASK  
    foreign key (SUPERTASK_)  
    references JBPM4_TASK; 
create index IDX_VAR_EXESYS on JBPM4_VARIABLE (EXESYS_); 
create index IDX_VAR_TASK on JBPM4_VARIABLE (TASK_); 
create index IDX_VAR_EXECUTION on JBPM4_VARIABLE (EXECUTION_); 
create index IDX_VAR_LOB on JBPM4_VARIABLE (LOB_); 
alter table JBPM4_VARIABLE  
    add constraint FK_VAR_LOB  
    foreign key (LOB_)  
    references JBPM4_LOB; 
alter table JBPM4_VARIABLE  
    add constraint FK_VAR_EXECUTION  
    foreign key (EXECUTION_)  
    references JBPM4_EXECUTION; 
alter table JBPM4_VARIABLE  
    add constraint FK_VAR_EXESYS  
    foreign key (EXESYS_)  
    references JBPM4_EXECUTION; 
alter table JBPM4_VARIABLE  
    add constraint FK_VAR_TASK  
    foreign key (TASK_)  
    references JBPM4_TASK; 

下面是删除表语句

  1. alter table JBPM4_DEPLOYPROP   
  2.     drop constraint FK_DEPLPROP_DEPL;  
  3. alter table JBPM4_EXECUTION   
  4.     drop constraint FK_EXEC_PARENT;  
  5. alter table JBPM4_EXECUTION   
  6.     drop constraint FK_EXEC_SUBPI;  
  7. alter table JBPM4_EXECUTION   
  8.     drop constraint FK_EXEC_INSTANCE;  
  9. alter table JBPM4_EXECUTION   
  10.     drop constraint FK_EXEC_SUPEREXEC;  
  11. alter table JBPM4_HIST_ACTINST   
  12.     drop constraint FK_HACTI_HPROCI;  
  13. alter table JBPM4_HIST_ACTINST   
  14.     drop constraint FK_HTI_HTASK;  
  15. alter table JBPM4_HIST_DETAIL   
  16.     drop constraint FK_HDETAIL_HPROCI;  
  17. alter table JBPM4_HIST_DETAIL   
  18.     drop constraint FK_HDETAIL_HACTI;  
  19. alter table JBPM4_HIST_DETAIL   
  20.     drop constraint FK_HDETAIL_HTASK;  
  21. alter table JBPM4_HIST_DETAIL   
  22.     drop constraint FK_HDETAIL_HVAR;  
  23. alter table JBPM4_HIST_TASK   
  24.     drop constraint FK_HSUPERT_SUB;  
  25. alter table JBPM4_HIST_VAR   
  26.     drop constraint FK_HVAR_HPROCI;  
  27. alter table JBPM4_HIST_VAR   
  28.     drop constraint FK_HVAR_HTASK;  
  29. alter table JBPM4_ID_GROUP   
  30.     drop constraint FK_GROUP_PARENT;  
  31. alter table JBPM4_ID_MEMBERSHIP   
  32.     drop constraint FK_MEM_GROUP;  
  33. alter table JBPM4_ID_MEMBERSHIP   
  34.     drop constraint FK_MEM_USER;  
  35. alter table JBPM4_JOB   
  36.     drop constraint FK_JOB_CFG;  
  37. alter table JBPM4_LOB   
  38.     drop constraint FK_LOB_DEPLOYMENT;  
  39. alter table JBPM4_PARTICIPATION   
  40.     drop constraint FK_PART_SWIMLANE;  
  41. alter table JBPM4_PARTICIPATION   
  42.     drop constraint FK_PART_TASK;  
  43. alter table JBPM4_SWIMLANE   
  44.     drop constraint FK_SWIMLANE_EXEC;  
  45. alter table JBPM4_TASK   
  46.     drop constraint FK_TASK_SWIML;  
  47. alter table JBPM4_TASK   
  48.     drop constraint FK_TASK_SUPERTASK;  
  49. alter table JBPM4_VARIABLE   
  50.     drop constraint FK_VAR_LOB;  
  51. alter table JBPM4_VARIABLE   
  52.     drop constraint FK_VAR_EXECUTION;  
  53. alter table JBPM4_VARIABLE   
  54.     drop constraint FK_VAR_EXESYS;  
  55. alter table JBPM4_VARIABLE   
  56.     drop constraint FK_VAR_TASK;  
  57. drop table JBPM4_DEPLOYMENT;  
  58. drop table JBPM4_DEPLOYPROP;  
  59. drop table JBPM4_EXECUTION;  
  60. drop table JBPM4_HIST_ACTINST;  
  61. drop table JBPM4_HIST_DETAIL;  
  62. drop table JBPM4_HIST_PROCINST;  
  63. drop table JBPM4_HIST_TASK;  
  64. drop table JBPM4_HIST_VAR;  
  65. drop table JBPM4_ID_GROUP;  
  66. drop table JBPM4_ID_MEMBERSHIP;  
  67. drop table JBPM4_ID_USER;  
  68. drop table JBPM4_JOB;  
  69. drop table JBPM4_LOB;  
  70. drop table JBPM4_PARTICIPATION;  
  71. drop table JBPM4_PROPERTY;  
  72. drop table JBPM4_SWIMLANE;  
  73. drop table JBPM4_TASK;  
  74. drop table JBPM4_VARIABLE; 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值