create table fad_oa.ACT_HI_VARINST
(
    ID_                varchar(64)   not null
        primary key,
    REV_               int default 1 null,
    PROC_INST_ID_      varchar(64)   null,
    EXECUTION_ID_      varchar(64)   null,
    TASK_ID_           varchar(64)   null,
    NAME_              varchar(255)  not null,
    VAR_TYPE_          varchar(100)  null,
    SCOPE_ID_          varchar(255)  null,
    SUB_SCOPE_ID_      varchar(255)  null,
    SCOPE_TYPE_        varchar(255)  null,
    BYTEARRAY_ID_      varchar(64)   null,
    DOUBLE_            double        null,
    LONG_              bigint        null,
    TEXT_              varchar(4000) null,
    TEXT2_             varchar(4000) null,
    CREATE_TIME_       datetime(3)   null,
    LAST_UPDATED_TIME_ datetime(3)   null
)
    collate = utf8mb3_bin;

create index ACT_IDX_HI_PROCVAR_EXE
    on fad_oa.ACT_HI_VARINST (EXECUTION_ID_);

create index ACT_IDX_HI_PROCVAR_NAME_TYPE
    on fad_oa.ACT_HI_VARINST (NAME_, VAR_TYPE_);

create index ACT_IDX_HI_PROCVAR_PROC_INST
    on fad_oa.ACT_HI_VARINST (PROC_INST_ID_);

create index ACT_IDX_HI_PROCVAR_TASK_ID
    on fad_oa.ACT_HI_VARINST (TASK_ID_);

create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE
    on fad_oa.ACT_HI_VARINST (SCOPE_ID_, SCOPE_TYPE_);

create index ACT_IDX_HI_VAR_SUB_ID_TYPE
    on fad_oa.ACT_HI_VARINST (SUB_SCOPE_ID_, SCOPE_TYPE_);

