create table fad_oa.ACT_HI_PROCINST
(
    ID_                        varchar(64)             not null
        primary key,
    REV_                       int          default 1  null,
    PROC_INST_ID_              varchar(64)             not null,
    BUSINESS_KEY_              varchar(255)            null,
    PROC_DEF_ID_               varchar(64)             not null,
    START_TIME_                datetime(3)             not null,
    END_TIME_                  datetime(3)             null,
    DURATION_                  bigint                  null,
    START_USER_ID_             varchar(255)            null,
    START_ACT_ID_              varchar(255)            null,
    END_ACT_ID_                varchar(255)            null,
    SUPER_PROCESS_INSTANCE_ID_ varchar(64)             null,
    DELETE_REASON_             varchar(4000)           null,
    TENANT_ID_                 varchar(255) default '' null,
    NAME_                      varchar(255)            null,
    CALLBACK_ID_               varchar(255)            null,
    CALLBACK_TYPE_             varchar(255)            null,
    REFERENCE_ID_              varchar(255)            null,
    REFERENCE_TYPE_            varchar(255)            null,
    PROPAGATED_STAGE_INST_ID_  varchar(255)            null,
    BUSINESS_STATUS_           varchar(255)            null,
    constraint PROC_INST_ID_
        unique (PROC_INST_ID_)
)
    collate = utf8mb3_bin;

create index ACT_IDX_HI_PRO_INST_END
    on fad_oa.ACT_HI_PROCINST (END_TIME_);

create index ACT_IDX_HI_PRO_I_BUSKEY
    on fad_oa.ACT_HI_PROCINST (BUSINESS_KEY_);

create index ACT_IDX_HI_PRO_SUPER_PROCINST
    on fad_oa.ACT_HI_PROCINST (SUPER_PROCESS_INSTANCE_ID_);

