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; 

下面是删除表语句

  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; 

相关推荐