ry-seata.sql 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 华光机电
  4. Source Server Type : MySQL
  5. Source Server Version : 50637
  6. Source Schema : ry-seata
  7. Target Server Type : MySQL
  8. Target Server Version : 50637
  9. File Encoding : 65001
  10. Date: 05/01/2024 17:34:22
  11. */
  12. SET NAMES utf8mb4;
  13. SET FOREIGN_KEY_CHECKS = 0;
  14. -- ----------------------------
  15. -- Table structure for branch_table
  16. -- ----------------------------
  17. DROP TABLE IF EXISTS `branch_table`;
  18. CREATE TABLE `branch_table` (
  19. `branch_id` bigint(20) NOT NULL,
  20. `xid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  21. `transaction_id` bigint(20) NULL DEFAULT NULL,
  22. `resource_group_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  23. `resource_id` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  24. `branch_type` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  25. `status` tinyint(4) NULL DEFAULT NULL,
  26. `client_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  27. `application_data` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  28. `gmt_create` datetime(6) NULL DEFAULT NULL,
  29. `gmt_modified` datetime(6) NULL DEFAULT NULL,
  30. PRIMARY KEY (`branch_id`) USING BTREE,
  31. INDEX `idx_xid`(`xid`) USING BTREE
  32. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
  33. -- ----------------------------
  34. -- Table structure for global_table
  35. -- ----------------------------
  36. DROP TABLE IF EXISTS `global_table`;
  37. CREATE TABLE `global_table` (
  38. `xid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  39. `transaction_id` bigint(20) NULL DEFAULT NULL,
  40. `status` tinyint(4) NOT NULL,
  41. `application_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  42. `transaction_service_group` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  43. `transaction_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  44. `timeout` int(11) NULL DEFAULT NULL,
  45. `begin_time` bigint(20) NULL DEFAULT NULL,
  46. `application_data` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  47. `gmt_create` datetime(0) NULL DEFAULT NULL,
  48. `gmt_modified` datetime(0) NULL DEFAULT NULL,
  49. PRIMARY KEY (`xid`) USING BTREE,
  50. INDEX `idx_gmt_modified_status`(`gmt_modified`, `status`) USING BTREE,
  51. INDEX `idx_transaction_id`(`transaction_id`) USING BTREE
  52. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
  53. -- ----------------------------
  54. -- Table structure for lock_table
  55. -- ----------------------------
  56. DROP TABLE IF EXISTS `lock_table`;
  57. CREATE TABLE `lock_table` (
  58. `row_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  59. `xid` varchar(96) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  60. `transaction_id` bigint(20) NULL DEFAULT NULL,
  61. `branch_id` bigint(20) NOT NULL,
  62. `resource_id` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  63. `table_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  64. `pk` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  65. `gmt_create` datetime(0) NULL DEFAULT NULL,
  66. `gmt_modified` datetime(0) NULL DEFAULT NULL,
  67. PRIMARY KEY (`row_key`) USING BTREE,
  68. INDEX `idx_branch_id`(`branch_id`) USING BTREE
  69. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
  70. -- ----------------------------
  71. -- Table structure for undo_log
  72. -- ----------------------------
  73. DROP TABLE IF EXISTS `undo_log`;
  74. CREATE TABLE `undo_log` (
  75. `branch_id` bigint(20) NOT NULL COMMENT 'branch transaction id',
  76. `xid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'global transaction id',
  77. `context` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'undo_log context,such as serialization',
  78. `rollback_info` longblob NOT NULL COMMENT 'rollback info',
  79. `log_status` int(11) NOT NULL COMMENT '0:normal status,1:defense status',
  80. `log_created` datetime(6) NOT NULL COMMENT 'create datetime',
  81. `log_modified` datetime(6) NOT NULL COMMENT 'modify datetime',
  82. UNIQUE INDEX `ux_undo_log`(`xid`, `branch_id`) USING BTREE
  83. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'AT transaction mode undo table' ROW_FORMAT = Compact;
  84. SET FOREIGN_KEY_CHECKS = 1;