h2_init.sql 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. create table if not exists seata_state_machine_def
  2. (
  3. id varchar(32) not null comment 'id',
  4. name varchar(128) not null comment 'name',
  5. tenant_id varchar(32) not null comment 'tenant id',
  6. app_name varchar(32) not null comment 'application name',
  7. type varchar(20) comment 'state language type',
  8. comment_ varchar(255) comment 'comment',
  9. ver varchar(16) not null comment 'version',
  10. gmt_create timestamp(3) not null comment 'create time',
  11. status varchar(2) not null comment 'status(AC:active|IN:inactive)',
  12. content clob comment 'content',
  13. recover_strategy varchar(16) comment 'transaction recover strategy(compensate|retry)',
  14. primary key (id)
  15. );
  16. create table if not exists seata_state_machine_inst
  17. (
  18. id varchar(128) not null comment 'id',
  19. machine_id varchar(32) not null comment 'state machine definition id',
  20. tenant_id varchar(32) not null comment 'tenant id',
  21. parent_id varchar(128) comment 'parent id',
  22. gmt_started timestamp(3) not null comment 'start time',
  23. business_key varchar(48) comment 'business key',
  24. start_params clob comment 'start parameters',
  25. gmt_end timestamp(3) comment 'end time',
  26. excep blob comment 'exception',
  27. end_params clob comment 'end parameters',
  28. status varchar(2) comment 'status(SU succeed|FA failed|UN unknown|SK skipped|RU running)',
  29. compensation_status varchar(2) comment 'compensation status(SU succeed|FA failed|UN unknown|SK skipped|RU running)',
  30. is_running tinyint(1) comment 'is running(0 no|1 yes)',
  31. gmt_updated timestamp(3) not null,
  32. primary key (id),
  33. unique key unikey_buz_tenant (business_key, tenant_id)
  34. );
  35. create table if not exists seata_state_inst
  36. (
  37. id varchar(48) not null comment 'id',
  38. machine_inst_id varchar(128) not null comment 'state machine instance id',
  39. name varchar(128) not null comment 'state name',
  40. type varchar(20) comment 'state type',
  41. service_name varchar(128) comment 'service name',
  42. service_method varchar(128) comment 'method name',
  43. service_type varchar(16) comment 'service type',
  44. business_key varchar(48) comment 'business key',
  45. state_id_compensated_for varchar(50) comment 'state compensated for',
  46. state_id_retried_for varchar(50) comment 'state retried for',
  47. gmt_started timestamp(3) not null comment 'start time',
  48. is_for_update tinyint(1) comment 'is service for update',
  49. input_params clob comment 'input parameters',
  50. output_params clob comment 'output parameters',
  51. status varchar(2) not null comment 'status(SU succeed|FA failed|UN unknown|SK skipped|RU running)',
  52. excep blob comment 'exception',
  53. gmt_updated timestamp(3) comment 'update time',
  54. gmt_end timestamp(3) comment 'end time',
  55. primary key (id, machine_inst_id)
  56. );