text: create table ACT_GE_PROPERTY (
      NAME_ varchar(64),
      VALUE_ varchar(300),
      REV_ integer,
      primary key (NAME_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  insert into ACT_GE_PROPERTY
  values ('schema.version', '5.9', 1);
  
  insert into ACT_GE_PROPERTY
  values ('schema.history', 'create(5.9)', 1);
  
  insert into ACT_GE_PROPERTY
  values ('next.dbid', '1', 1);
  
  create table ACT_GE_BYTEARRAY (
      ID_ varchar(64),
      REV_ integer,
      NAME_ varchar(255),
      DEPLOYMENT_ID_ varchar(64),
      BYTES_ LONGBLOB,
      GENERATED_ TINYINT,
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RE_DEPLOYMENT (
      ID_ varchar(64),
      NAME_ varchar(255),
      DEPLOY_TIME_ timestamp,
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RU_EXECUTION (
      ID_ varchar(64),
      REV_ integer,
      PROC_INST_ID_ varchar(64),
      BUSINESS_KEY_ varchar(255),
      PARENT_ID_ varchar(64),
      PROC_DEF_ID_ varchar(64),
      SUPER_EXEC_ varchar(64),
      ACT_ID_ varchar(255),
      IS_ACTIVE_ TINYINT,
      IS_CONCURRENT_ TINYINT,
      IS_SCOPE_ TINYINT,
      IS_EVENT_SCOPE_ TINYINT,
      SUSPENSION_STATE_ integer,
      primary key (ID_),
      unique ACT_UNIQ_RU_BUS_KEY (PROC_DEF_ID_, BUSINESS_KEY_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RU_JOB (
      ID_ varchar(64) NOT NULL,
  	  REV_ integer,
      TYPE_ varchar(255) NOT NULL,
      LOCK_EXP_TIME_ timestamp,
      LOCK_OWNER_ varchar(255),
      EXCLUSIVE_ boolean,
      EXECUTION_ID_ varchar(64),
      PROCESS_INSTANCE_ID_ varchar(64),
      RETRIES_ integer,
      EXCEPTION_STACK_ID_ varchar(64),
      EXCEPTION_MSG_ varchar(4000),
      DUEDATE_ timestamp NULL,
      REPEAT_ varchar(255),
      HANDLER_TYPE_ varchar(255),
      HANDLER_CFG_ varchar(4000),
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RE_PROCDEF (
      ID_ varchar(64),
      REV_ integer,
      CATEGORY_ varchar(255),
      NAME_ varchar(255),
      KEY_ varchar(255),
      VERSION_ integer,
      DEPLOYMENT_ID_ varchar(64),
      RESOURCE_NAME_ varchar(4000),
      DGRM_RESOURCE_NAME_ varchar(4000),
      HAS_START_FORM_KEY_ TINYINT,
      SUSPENSION_STATE_ integer,
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RU_TASK (
      ID_ varchar(64),
      REV_ integer,
      EXECUTION_ID_ varchar(64),
      PROC_INST_ID_ varchar(64),
      PROC_DEF_ID_ varchar(64),
      NAME_ varchar(255),
      PARENT_TASK_ID_ varchar(64),
      DESCRIPTION_ varchar(4000),
      TASK_DEF_KEY_ varchar(255),
      OWNER_ varchar(64),
      ASSIGNEE_ varchar(64),
      DELEGATION_ varchar(64),
      PRIORITY_ integer,
      CREATE_TIME_ timestamp,
      DUE_DATE_ datetime,
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RU_IDENTITYLINK (
      ID_ varchar(64),
      REV_ integer,
      GROUP_ID_ varchar(64),
      TYPE_ varchar(255),
      USER_ID_ varchar(64),
      TASK_ID_ varchar(64),
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RU_VARIABLE (
      ID_ varchar(64) not null,
      REV_ integer,
      TYPE_ varchar(255) not null,
      NAME_ varchar(255) not null,
      EXECUTION_ID_ varchar(64),
  	  PROC_INST_ID_ varchar(64),
      TASK_ID_ varchar(64),
      BYTEARRAY_ID_ varchar(64),
      DOUBLE_ double,
      LONG_ bigint,
      TEXT_ varchar(4000),
      TEXT2_ varchar(4000),
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create table ACT_RU_EVENT_SUBSCR (
      ID_ varchar(64) not null,
      REV_ integer,
      EVENT_TYPE_ varchar(255) not null,
      EVENT_NAME_ varchar(255),
      EXECUTION_ID_ varchar(64),
      PROC_INST_ID_ varchar(64),
      ACTIVITY_ID_ varchar(64),
      CONFIGURATION_ varchar(255),
      CREATED_ timestamp not null,
      primary key (ID_)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  
  create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
  create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
  create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
  create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
  create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
  
  alter table ACT_GE_BYTEARRAY
      add constraint ACT_FK_BYTEARR_DEPL 
      foreign key (DEPLOYMENT_ID_) 
      references ACT_RE_DEPLOYMENT (ID_);
  
  alter table ACT_RU_EXECUTION
      add constraint ACT_FK_EXE_PROCINST 
      foreign key (PROC_INST_ID_) 
      references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade;
  
  alter table ACT_RU_EXECUTION
      add constraint ACT_FK_EXE_PARENT 
      foreign key (PARENT_ID_) 
      references ACT_RU_EXECUTION (ID_);
      
  alter table ACT_RU_EXECUTION
      add constraint ACT_FK_EXE_SUPER 
      foreign key (SUPER_EXEC_) 
      references ACT_RU_EXECUTION (ID_);
      
  alter table ACT_RU_IDENTITYLINK
      add constraint ACT_FK_TSKASS_TASK 
      foreign key (TASK_ID_) 
      references ACT_RU_TASK (ID_);
      
  alter table ACT_RU_TASK
      add constraint ACT_FK_TASK_EXE
      foreign key (EXECUTION_ID_)
      references ACT_RU_EXECUTION (ID_);
      
  alter table ACT_RU_TASK
      add constraint ACT_FK_TASK_PROCINST
      foreign key (PROC_INST_ID_)
      references ACT_RU_EXECUTION (ID_);
      
  alter table ACT_RU_TASK
    add constraint ACT_FK_TASK_PROCDEF
    foreign key (PROC_DEF_ID_)
    references ACT_RE_PROCDEF (ID_);
    
  alter table ACT_RU_VARIABLE 
      add constraint ACT_FK_VAR_EXE 
      foreign key (EXECUTION_ID_) 
      references ACT_RU_EXECUTION (ID_);
  
  alter table ACT_RU_VARIABLE
      add constraint ACT_FK_VAR_PROCINST
      foreign key (PROC_INST_ID_)
      references ACT_RU_EXECUTION(ID_);
  
  alter table ACT_RU_VARIABLE 
      add constraint ACT_FK_VAR_BYTEARRAY 
      foreign key (BYTEARRAY_ID_) 
      references ACT_GE_BYTEARRAY (ID_);
  
  alter table ACT_RU_JOB 
      add constraint ACT_FK_JOB_EXCEPTION 
      foreign key (EXCEPTION_STACK_ID_) 
      references ACT_GE_BYTEARRAY (ID_);
  
  alter table ACT_RU_EVENT_SUBSCR
      add constraint ACT_FK_EVENT_EXEC
      foreign key (EXECUTION_ID_)
      references ACT_RU_EXECUTION(ID_);