Where can find the detailed description of the camunda tables

I am trying use mybatis to do custom query.
And everything fine but cannot find a detailied description of those tables.

Here is the struct of the ACT_HI_VARINST table

ID_ varchar(64) NO PRI “”
PROC_DEF_KEY_ varchar(255) YES MUL “”
PROC_DEF_ID_ varchar(64) YES “” “”
ROOT_PROC_INST_ID_ varchar(64) YES MUL “”
PROC_INST_ID_ varchar(64) YES MUL “”
EXECUTION_ID_ varchar(64) YES “” “”
ACT_INST_ID_ varchar(64) YES “” “”
CASE_DEF_KEY_ varchar(255) YES “” “”
CASE_DEF_ID_ varchar(64) YES “” “”
CASE_INST_ID_ varchar(64) YES MUL “”
CASE_EXECUTION_ID_ varchar(64) YES “” “”
TASK_ID_ varchar(64) YES “” “”
NAME_ varchar(255) NO MUL “”
VAR_TYPE_ varchar(100) YES “” “”
CREATE_TIME_ datetime YES “” “”
REV_ int(11) YES “” “”
BYTEARRAY_ID_ varchar(64) YES MUL “”
DOUBLE_ double YES “” “”
LONG_ bigint(20) YES “” “”
TEXT_ varchar(4000) YES “” “”
TEXT2_ varchar(4000) YES “” “”
TENANT_ID_ varchar(64) YES MUL “”
STATE_ varchar(20) YES “” “”
REMOVAL_TIME_ datetime YES MUL “”

I know the VAR_TYPE have a relation with LONG_ and TEXT_ and DOUBLE_
The VAR_TYPE defined the column of stored the variable value.

Most of the relations I already known but the TEXT_2 column.
I need to know the relation beetween the VAR_TYPE and TEXT_2
What is the VAR_TYPE column value when TEXT_2 value has a value.

Thanks you all.

You’ll hopefully be able to find any answers you need in the docs:
https://docs.camunda.org/manual/latest/user-guide/process-engine/database/

Hi @Niall
Thank you.
but I am already read this doc but this doc did not detailed enghout this table.
Here is the table struct

This table designed use four column to store variable value this make me confused.
My question is how to know which column stroed the variable value.

I am trying to run custom sql to get the variable name and varible value.
Here is the sql

select case
when variable.VAR_TYPE_ = 'boolean'
  then variable.LONG_
when variable.VAR_TYPE_ = 'string'
  then variable.TEXT_
when variable.VAR_TYPE_ = what is the value of VAR_TYPE when variable value stored at the TEXT2_ column
  then variable.TEXT2_
end as value,

       variable.NAME_ as name
from ACT_HI_VARINST variable;

Thank you again.