JBPM4 sqlserver建表语句
JBPM4没有自带sqlserver的脚本,所以只能自己创建数据表
下面是建表语句:
createtableJBPM4_DEPLOYMENT(
DBID_numeric(19,0)notnull,
NAME_varchar(255),
TIMESTAMP_numeric(19,0),
STATE_varchar(255),
primarykey(DBID_)
);
createtableJBPM4_DEPLOYPROP(
DBID_numeric(19,0)notnull,
DEPLOYMENT_numeric(19,0),
OBJNAME_varchar(255),
KEY_varchar(255),
STRINGVAL_varchar(255),
LONGVAL_numeric(19,0),
primarykey(DBID_)
);
createtableJBPM4_EXECUTION(
DBID_numeric(19,0)notnull,
CLASS_varchar(255)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_HIST_ACTINST(
DBID_numeric(19,0)notnull,
CLASS_varchar(255)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_HIST_DETAIL(
DBID_numeric(19,0)notnull,
CLASS_varchar(255)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_HIST_PROCINST(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_HIST_TASK(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_HIST_VAR(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
PROCINSTID_varchar(255),
EXECUTIONID_varchar(255),
VARNAME_varchar(255),
VALUE_varchar(255),
HPROCI_numeric(19,0),
HTASK_numeric(19,0),
primarykey(DBID_)
);
createtableJBPM4_ID_GROUP(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
ID_varchar(255),
NAME_varchar(255),
TYPE_varchar(255),
PARENT_numeric(19,0),
primarykey(DBID_)
);
createtableJBPM4_ID_MEMBERSHIP(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
USER_numeric(19,0),
GROUP_numeric(19,0),
NAME_varchar(255),
primarykey(DBID_)
);
createtableJBPM4_ID_USER(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
ID_varchar(255),
PASSWORD_varchar(255),
GIVENNAME_varchar(255),
FAMILYNAME_varchar(255),
BUSINESSEMAIL_varchar(255),
primarykey(DBID_)
);
createtableJBPM4_JOB(
DBID_numeric(19,0)notnull,
CLASS_varchar(255)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_LOB(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
BLOB_VALUE_image,
DEPLOYMENT_numeric(19,0),
NAME_text,
primarykey(DBID_)
);
createtableJBPM4_PARTICIPATION(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
GROUPID_varchar(255),
USERID_varchar(255),
TYPE_varchar(255),
TASK_numeric(19,0),
SWIMLANE_numeric(19,0),
primarykey(DBID_)
);
createtableJBPM4_PROPERTY(
KEY_varchar(255)notnull,
VERSION_numeric(10,0)notnull,
VALUE_varchar(255),
primarykey(KEY_)
);
createtableJBPM4_SWIMLANE(
DBID_numeric(19,0)notnull,
DBVERSION_numeric(10,0)notnull,
NAME_varchar(255),
ASSIGNEE_varchar(255),
EXECUTION_numeric(19,0),
primarykey(DBID_)
);
createtableJBPM4_TASK(
DBID_numeric(19,0)notnull,
CLASS_char(1)notnull,
DBVERSION_numeric(10,0)notnull,
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),
primarykey(DBID_)
);
createtableJBPM4_VARIABLE(
DBID_numeric(19,0)notnull,
CLASS_varchar(255)notnull,
DBVERSION_numeric(10,0)notnull,
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_doubleprecision,
CLASSNAME_varchar(255),
LONG_VALUE_numeric(19,0),
STRING_VALUE_varchar(255),
TEXT_VALUE_text,
EXESYS_numeric(19,0),
primarykey(DBID_)
);
createindexIDX_DEPLPROP_DEPLonJBPM4_DEPLOYPROP(DEPLOYMENT_);
altertableJBPM4_DEPLOYPROP
addconstraintFK_DEPLPROP_DEPL
foreignkey(DEPLOYMENT_)
referencesJBPM4_DEPLOYMENT;
createindexIDX_EXEC_SUPEREXEConJBPM4_EXECUTION(SUPEREXEC_);
createindexIDX_EXEC_INSTANCEonJBPM4_EXECUTION(INSTANCE_);
createindexIDX_EXEC_SUBPIonJBPM4_EXECUTION(SUBPROCINST_);
createindexIDX_EXEC_PARENTonJBPM4_EXECUTION(PARENT_);
altertableJBPM4_EXECUTION
addconstraintFK_EXEC_PARENT
foreignkey(PARENT_)
referencesJBPM4_EXECUTION;
altertableJBPM4_EXECUTION
addconstraintFK_EXEC_SUBPI
foreignkey(SUBPROCINST_)
referencesJBPM4_EXECUTION;
altertableJBPM4_EXECUTION
addconstraintFK_EXEC_INSTANCE
foreignkey(INSTANCE_)
referencesJBPM4_EXECUTION;
altertableJBPM4_EXECUTION
addconstraintFK_EXEC_SUPEREXEC
foreignkey(SUPEREXEC_)
referencesJBPM4_EXECUTION;
createindexIDX_HACTI_HPROCIonJBPM4_HIST_ACTINST(HPROCI_);
createindexIDX_HTI_HTASKonJBPM4_HIST_ACTINST(HTASK_);
altertableJBPM4_HIST_ACTINST
addconstraintFK_HACTI_HPROCI
foreignkey(HPROCI_)
referencesJBPM4_HIST_PROCINST;
altertableJBPM4_HIST_ACTINST
addconstraintFK_HTI_HTASK
foreignkey(HTASK_)
referencesJBPM4_HIST_TASK;
createindexIDX_HDET_HACTIonJBPM4_HIST_DETAIL(HACTI_);
createindexIDX_HDET_HPROCIonJBPM4_HIST_DETAIL(HPROCI_);
createindexIDX_HDET_HVARonJBPM4_HIST_DETAIL(HVAR_);
createindexIDX_HDET_HTASKonJBPM4_HIST_DETAIL(HTASK_);
altertableJBPM4_HIST_DETAIL
addconstraintFK_HDETAIL_HPROCI
foreignkey(HPROCI_)
referencesJBPM4_HIST_PROCINST;
altertableJBPM4_HIST_DETAIL
addconstraintFK_HDETAIL_HACTI
foreignkey(HACTI_)
referencesJBPM4_HIST_ACTINST;
altertableJBPM4_HIST_DETAIL
addconstraintFK_HDETAIL_HTASK
foreignkey(HTASK_)
referencesJBPM4_HIST_TASK;
altertableJBPM4_HIST_DETAIL
addconstraintFK_HDETAIL_HVAR
foreignkey(HVAR_)
referencesJBPM4_HIST_VAR;
createindexIDX_HSUPERT_SUBonJBPM4_HIST_TASK(SUPERTASK_);
altertableJBPM4_HIST_TASK
addconstraintFK_HSUPERT_SUB
foreignkey(SUPERTASK_)
referencesJBPM4_HIST_TASK;
createindexIDX_HVAR_HPROCIonJBPM4_HIST_VAR(HPROCI_);
createindexIDX_HVAR_HTASKonJBPM4_HIST_VAR(HTASK_);
altertableJBPM4_HIST_VAR
addconstraintFK_HVAR_HPROCI
foreignkey(HPROCI_)
referencesJBPM4_HIST_PROCINST;
altertableJBPM4_HIST_VAR
addconstraintFK_HVAR_HTASK
foreignkey(HTASK_)
referencesJBPM4_HIST_TASK;
createindexIDX_GROUP_PARENTonJBPM4_ID_GROUP(PARENT_);
altertableJBPM4_ID_GROUP
addconstraintFK_GROUP_PARENT
foreignkey(PARENT_)
referencesJBPM4_ID_GROUP;
createindexIDX_MEM_USERonJBPM4_ID_MEMBERSHIP(USER_);
createindexIDX_MEM_GROUPonJBPM4_ID_MEMBERSHIP(GROUP_);
altertableJBPM4_ID_MEMBERSHIP
addconstraintFK_MEM_GROUP
foreignkey(GROUP_)
referencesJBPM4_ID_GROUP;
altertableJBPM4_ID_MEMBERSHIP
addconstraintFK_MEM_USER
foreignkey(USER_)
referencesJBPM4_ID_USER;
createindexIDX_JOBRETRIESonJBPM4_JOB(RETRIES_);
createindexIDX_JOB_CFGonJBPM4_JOB(CFG_);
createindexIDX_JOB_PRINSTonJBPM4_JOB(PROCESSINSTANCE_);
createindexIDX_JOB_EXEonJBPM4_JOB(EXECUTION_);
createindexIDX_JOBLOCKEXPonJBPM4_JOB(LOCKEXPTIME_);
createindexIDX_JOBDUEDATEonJBPM4_JOB(DUEDATE_);
altertableJBPM4_JOB
addconstraintFK_JOB_CFG
foreignkey(CFG_)
referencesJBPM4_LOB;
createindexIDX_LOB_DEPLOYMENTonJBPM4_LOB(DEPLOYMENT_);
altertableJBPM4_LOB
addconstraintFK_LOB_DEPLOYMENT
foreignkey(DEPLOYMENT_)
referencesJBPM4_DEPLOYMENT;
createindexIDX_PART_TASKonJBPM4_PARTICIPATION(TASK_);
altertableJBPM4_PARTICIPATION
addconstraintFK_PART_SWIMLANE
foreignkey(SWIMLANE_)
referencesJBPM4_SWIMLANE;
altertableJBPM4_PARTICIPATION
addconstraintFK_PART_TASK
foreignkey(TASK_)
referencesJBPM4_TASK;
createindexIDX_SWIMLANE_EXEConJBPM4_SWIMLANE(EXECUTION_);
altertableJBPM4_SWIMLANE
addconstraintFK_SWIMLANE_EXEC
foreignkey(EXECUTION_)
referencesJBPM4_EXECUTION;
createindexIDX_TASK_SUPERTASKonJBPM4_TASK(SUPERTASK_);
altertableJBPM4_TASK
addconstraintFK_TASK_SWIML
foreignkey(SWIMLANE_)
referencesJBPM4_SWIMLANE;
altertableJBPM4_TASK
addconstraintFK_TASK_SUPERTASK
foreignkey(SUPERTASK_)
referencesJBPM4_TASK;
createindexIDX_VAR_EXESYSonJBPM4_VARIABLE(EXESYS_);
createindexIDX_VAR_TASKonJBPM4_VARIABLE(TASK_);
createindexIDX_VAR_EXECUTIONonJBPM4_VARIABLE(EXECUTION_);
createindexIDX_VAR_LOBonJBPM4_VARIABLE(LOB_);
altertableJBPM4_VARIABLE
addconstraintFK_VAR_LOB
foreignkey(LOB_)
referencesJBPM4_LOB;
altertableJBPM4_VARIABLE
addconstraintFK_VAR_EXECUTION
foreignkey(EXECUTION_)
referencesJBPM4_EXECUTION;
altertableJBPM4_VARIABLE
addconstraintFK_VAR_EXESYS
foreignkey(EXESYS_)
referencesJBPM4_EXECUTION;
altertableJBPM4_VARIABLE
addconstraintFK_VAR_TASK
foreignkey(TASK_)
references JBPM4_TASK;下面是删除表语句
- alter table JBPM4_DEPLOYPROP
- drop constraint FK_DEPLPROP_DEPL;
- alter table JBPM4_EXECUTION
- drop constraint FK_EXEC_PARENT;
- alter table JBPM4_EXECUTION
- drop constraint FK_EXEC_SUBPI;
- alter table JBPM4_EXECUTION
- drop constraint FK_EXEC_INSTANCE;
- alter table JBPM4_EXECUTION
- drop constraint FK_EXEC_SUPEREXEC;
- alter table JBPM4_HIST_ACTINST
- drop constraint FK_HACTI_HPROCI;
- alter table JBPM4_HIST_ACTINST
- drop constraint FK_HTI_HTASK;
- alter table JBPM4_HIST_DETAIL
- drop constraint FK_HDETAIL_HPROCI;
- alter table JBPM4_HIST_DETAIL
- drop constraint FK_HDETAIL_HACTI;
- alter table JBPM4_HIST_DETAIL
- drop constraint FK_HDETAIL_HTASK;
- alter table JBPM4_HIST_DETAIL
- drop constraint FK_HDETAIL_HVAR;
- alter table JBPM4_HIST_TASK
- drop constraint FK_HSUPERT_SUB;
- alter table JBPM4_HIST_VAR
- drop constraint FK_HVAR_HPROCI;
- alter table JBPM4_HIST_VAR
- drop constraint FK_HVAR_HTASK;
- alter table JBPM4_ID_GROUP
- drop constraint FK_GROUP_PARENT;
- alter table JBPM4_ID_MEMBERSHIP
- drop constraint FK_MEM_GROUP;
- alter table JBPM4_ID_MEMBERSHIP
- drop constraint FK_MEM_USER;
- alter table JBPM4_JOB
- drop constraint FK_JOB_CFG;
- alter table JBPM4_LOB
- drop constraint FK_LOB_DEPLOYMENT;
- alter table JBPM4_PARTICIPATION
- drop constraint FK_PART_SWIMLANE;
- alter table JBPM4_PARTICIPATION
- drop constraint FK_PART_TASK;
- alter table JBPM4_SWIMLANE
- drop constraint FK_SWIMLANE_EXEC;
- alter table JBPM4_TASK
- drop constraint FK_TASK_SWIML;
- alter table JBPM4_TASK
- drop constraint FK_TASK_SUPERTASK;
- alter table JBPM4_VARIABLE
- drop constraint FK_VAR_LOB;
- alter table JBPM4_VARIABLE
- drop constraint FK_VAR_EXECUTION;
- alter table JBPM4_VARIABLE
- drop constraint FK_VAR_EXESYS;
- alter table JBPM4_VARIABLE
- drop constraint FK_VAR_TASK;
- drop table JBPM4_DEPLOYMENT;
- drop table JBPM4_DEPLOYPROP;
- drop table JBPM4_EXECUTION;
- drop table JBPM4_HIST_ACTINST;
- drop table JBPM4_HIST_DETAIL;
- drop table JBPM4_HIST_PROCINST;
- drop table JBPM4_HIST_TASK;
- drop table JBPM4_HIST_VAR;
- drop table JBPM4_ID_GROUP;
- drop table JBPM4_ID_MEMBERSHIP;
- drop table JBPM4_ID_USER;
- drop table JBPM4_JOB;
- drop table JBPM4_LOB;
- drop table JBPM4_PARTICIPATION;
- drop table JBPM4_PROPERTY;
- drop table JBPM4_SWIMLANE;
- drop table JBPM4_TASK;
- drop table JBPM4_VARIABLE;