mirror of https://github.com/jeecgboot/jeecg-boot
EightMonth
4 weeks ago
1 changed files with 72 additions and 74 deletions
@ -1,79 +1,77 @@ |
|||||||
/* |
-- -------------------------------- The script used when storeMode is 'db' -------------------------------- |
||||||
Navicat Premium Data Transfer |
-- the table to store GlobalSession data |
||||||
|
DROP TABLE IF EXISTS `global_table`; |
||||||
Source Server : localhost |
CREATE TABLE IF NOT EXISTS `global_table` |
||||||
Source Server Type : MariaDB |
( |
||||||
Source Server Version : 100316 |
`xid` VARCHAR(128) NOT NULL, |
||||||
Source Host : localhost:3300 |
`transaction_id` BIGINT, |
||||||
Source Schema : seata |
`status` TINYINT NOT NULL, |
||||||
|
`application_id` VARCHAR(32), |
||||||
Target Server Type : MariaDB |
`transaction_service_group` VARCHAR(32), |
||||||
Target Server Version : 100316 |
`transaction_name` VARCHAR(128), |
||||||
File Encoding : 65001 |
`timeout` INT, |
||||||
|
`begin_time` BIGINT, |
||||||
Date: 05/01/2022 20:25:07 |
`application_data` VARCHAR(2000), |
||||||
*/ |
`gmt_create` DATETIME, |
||||||
|
`gmt_modified` DATETIME, |
||||||
SET NAMES utf8mb4; |
PRIMARY KEY (`xid`), |
||||||
SET FOREIGN_KEY_CHECKS = 0; |
KEY `idx_status_gmt_modified` (`status` , `gmt_modified`), |
||||||
|
KEY `idx_transaction_id` (`transaction_id`) |
||||||
|
) ENGINE = InnoDB |
||||||
|
DEFAULT CHARSET = utf8mb4; |
||||||
|
|
||||||
-- ---------------------------- |
-- the table to store BranchSession data |
||||||
-- Table structure for branch_table |
|
||||||
-- ---------------------------- |
|
||||||
DROP TABLE IF EXISTS `branch_table`; |
DROP TABLE IF EXISTS `branch_table`; |
||||||
CREATE TABLE `branch_table` ( |
CREATE TABLE IF NOT EXISTS `branch_table` |
||||||
`branch_id` bigint(20) NOT NULL, |
( |
||||||
`xid` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, |
`branch_id` BIGINT NOT NULL, |
||||||
`transaction_id` bigint(20) NULL DEFAULT NULL, |
`xid` VARCHAR(128) NOT NULL, |
||||||
`resource_group_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`transaction_id` BIGINT, |
||||||
`resource_id` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`resource_group_id` VARCHAR(32), |
||||||
`branch_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`resource_id` VARCHAR(256), |
||||||
`status` tinyint(4) NULL DEFAULT NULL, |
`branch_type` VARCHAR(8), |
||||||
`client_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`status` TINYINT, |
||||||
`application_data` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`client_id` VARCHAR(64), |
||||||
`gmt_create` datetime(6) NULL DEFAULT NULL, |
`application_data` VARCHAR(2000), |
||||||
`gmt_modified` datetime(6) NULL DEFAULT NULL, |
`gmt_create` DATETIME(6), |
||||||
PRIMARY KEY (`branch_id`) USING BTREE, |
`gmt_modified` DATETIME(6), |
||||||
INDEX `idx_xid`(`xid`) USING BTREE |
PRIMARY KEY (`branch_id`), |
||||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; |
KEY `idx_xid` (`xid`) |
||||||
|
) ENGINE = InnoDB |
||||||
-- ---------------------------- |
DEFAULT CHARSET = utf8mb4; |
||||||
-- Table structure for global_table |
|
||||||
-- ---------------------------- |
|
||||||
DROP TABLE IF EXISTS `global_table`; |
|
||||||
CREATE TABLE `global_table` ( |
|
||||||
`xid` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, |
|
||||||
`transaction_id` bigint(20) NULL DEFAULT NULL, |
|
||||||
`status` tinyint(4) NOT NULL, |
|
||||||
`application_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|
||||||
`transaction_service_group` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|
||||||
`transaction_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|
||||||
`timeout` int(11) NULL DEFAULT NULL, |
|
||||||
`begin_time` bigint(20) NULL DEFAULT NULL, |
|
||||||
`application_data` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|
||||||
`gmt_create` datetime(0) NULL DEFAULT NULL, |
|
||||||
`gmt_modified` datetime(0) NULL DEFAULT NULL, |
|
||||||
PRIMARY KEY (`xid`) USING BTREE, |
|
||||||
INDEX `idx_gmt_modified_status`(`gmt_modified`, `status`) USING BTREE, |
|
||||||
INDEX `idx_transaction_id`(`transaction_id`) USING BTREE |
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; |
|
||||||
|
|
||||||
-- ---------------------------- |
-- the table to store lock data |
||||||
-- Table structure for lock_table |
|
||||||
-- ---------------------------- |
|
||||||
DROP TABLE IF EXISTS `lock_table`; |
DROP TABLE IF EXISTS `lock_table`; |
||||||
CREATE TABLE `lock_table` ( |
CREATE TABLE IF NOT EXISTS `lock_table` |
||||||
`row_key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, |
( |
||||||
`xid` varchar(96) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`row_key` VARCHAR(128) NOT NULL, |
||||||
`transaction_id` bigint(20) NULL DEFAULT NULL, |
`xid` VARCHAR(128), |
||||||
`branch_id` bigint(20) NOT NULL, |
`transaction_id` BIGINT, |
||||||
`resource_id` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`branch_id` BIGINT NOT NULL, |
||||||
`table_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`resource_id` VARCHAR(256), |
||||||
`pk` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
`table_name` VARCHAR(32), |
||||||
`gmt_create` datetime(0) NULL DEFAULT NULL, |
`pk` VARCHAR(36), |
||||||
`gmt_modified` datetime(0) NULL DEFAULT NULL, |
`status` TINYINT NOT NULL DEFAULT '0' COMMENT '0:locked ,1:rollbacking', |
||||||
PRIMARY KEY (`row_key`) USING BTREE, |
`gmt_create` DATETIME, |
||||||
INDEX `idx_branch_id`(`branch_id`) USING BTREE |
`gmt_modified` DATETIME, |
||||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; |
PRIMARY KEY (`row_key`), |
||||||
|
KEY `idx_status` (`status`), |
||||||
|
KEY `idx_branch_id` (`branch_id`), |
||||||
|
KEY `idx_xid` (`xid`) |
||||||
|
) ENGINE = InnoDB |
||||||
|
DEFAULT CHARSET = utf8mb4; |
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `distributed_lock`; |
||||||
|
CREATE TABLE IF NOT EXISTS `distributed_lock` |
||||||
|
( |
||||||
|
`lock_key` CHAR(20) NOT NULL, |
||||||
|
`lock_value` VARCHAR(20) NOT NULL, |
||||||
|
`expire` BIGINT, |
||||||
|
primary key (`lock_key`) |
||||||
|
) ENGINE = InnoDB |
||||||
|
DEFAULT CHARSET = utf8mb4; |
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1; |
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0); |
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0); |
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0); |
||||||
|
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0); |
Loading…
Reference in new issue