DROP TABLE IF EXISTS `dtf_undo_log`;
CREATE TABLE `dtf_undo_log` (
  `group_id` varchar(20) NOT NULL COMMENT '事务分组ID',
  `tx_id` BIGINT(20) NOT NULL COMMENT '主事务ID',
  `branch_id` BIGINT(20) NOT NULL COMMENT '分支事务ID',
  `undo_info` BLOB NULL COMMENT 'UNDO信息',
  `creation_time` BIGINT(20) NULL COMMENT '创建时间',
  PRIMARY KEY (`group_id`, `tx_id`, `branch_id`))
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT = 'Tencent DTF事务UNDO日志表';

DROP TABLE IF EXISTS `dtf_global_line_lock`;
CREATE TABLE `dtf_global_line_lock` (
  `lock_hash` binary(16) NOT NULL COMMENT '行锁的Hash值',
  `group_id` varchar(20) NOT NULL COMMENT '事务分组ID',
  `tx_id` bigint(20) NOT NULL COMMENT '主事务ID',
  `branch_id_stack` text NOT NULL COMMENT '分支事务ID栈',
  `branch_id` bigint(20) NOT NULL COMMENT '栈顶分支事务ID',
  PRIMARY KEY (`lock_hash`),
  KEY (`group_id`, `tx_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tencent DTF事务全局锁表';