@@ -13,138 +13,150 @@ DROP TABLE IF EXISTS `sync_blocks`;
1313CREATE TABLE `sync_blocks `
1414(
1515 ` id` bigint NOT NULL AUTO_INCREMENT,
16- ` created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
17- ` updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
18- ` blockchain` varchar (32 ) NOT NULL COMMENT ' chain name ' ,
19- ` miner` varchar (42 ) NOT NULL COMMENT ' miner ' ,
20- ` block_time` bigint NOT NULL COMMENT ' block_time ' ,
21- ` block_number` bigint NOT NULL COMMENT ' block_number ' ,
22- ` block_hash` varchar (66 ) NOT NULL COMMENT ' block hash ' ,
23- ` tx_count` bigint NOT NULL COMMENT ' tx count ' ,
24- ` event_count` bigint NOT NULL COMMENT ' event count ' ,
25- ` parent_hash` varchar (66 ) NOT NULL COMMENT ' parent hash ' ,
26- ` status` varchar (32 ) NOT NULL COMMENT ' status ' ,
27- ` check_count` bigint NOT NULL COMMENT ' check count ' ,
16+ ` created_at` datetime DEFAULT CURRENT_TIMESTAMP ,
17+ ` updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
18+ ` blockchain` varchar (32 ) NOT NULL ,
19+ ` miner` varchar (42 ) NOT NULL ,
20+ ` block_time` bigint NOT NULL ,
21+ ` block_number` bigint NOT NULL ,
22+ ` block_hash` varchar (66 ) NOT NULL ,
23+ ` tx_count` bigint NOT NULL ,
24+ ` event_count` bigint NOT NULL ,
25+ ` parent_hash` varchar (66 ) NOT NULL ,
26+ ` status` varchar (32 ) NOT NULL ,
27+ ` check_count` bigint NOT NULL ,
2828 PRIMARY KEY (` id` ),
29+ KEY ` tx_count` (` tx_count` ),
2930 KEY ` status_index` (` status` ),
30- KEY ` tx_count_index` (` tx_count` ),
31- KEY ` check_count_index` (` check_count` )
31+ KEY ` check_count` (` check_count` )
3232) ENGINE = InnoDB
33- AUTO_INCREMENT = 2923365
34- DEFAULT CHARSET = utf8mb4
35- COLLATE = utf8mb4_0900_ai_ci;
36-
33+ AUTO_INCREMENT = 3343515
34+ DEFAULT CHARSET = utf8mb3;
3735-- ----------------------------
3836-- Table structure for sync_events
3937-- ----------------------------
4038DROP TABLE IF EXISTS ` sync_events` ;
4139CREATE TABLE `sync_events `
4240(
43- ` id` bigint NOT NULL AUTO_INCREMENT,
44- ` created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
45- ` updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
46- ` sync_block_id` bigint NOT NULL COMMENT ' sync_block_id ' ,
47- ` blockchain` varchar (32 ) NOT NULL COMMENT ' blockchain ' ,
48- ` block_time` bigint NOT NULL COMMENT ' block_time ' ,
49- ` block_number` bigint NOT NULL COMMENT ' block_number ' ,
50- ` block_hash` varchar (66 ) NOT NULL COMMENT ' block_hash ' ,
51- ` block_log_indexed` bigint NOT NULL COMMENT ' block_log_indexed ' ,
52- ` tx_index` bigint NOT NULL COMMENT ' tx_index ' ,
53- ` tx_hash` varchar (66 ) NOT NULL COMMENT ' tx_hash ' ,
54- ` event_name` varchar (32 ) NOT NULL COMMENT ' event_name ' ,
55- ` event_hash` varchar (66 ) NOT NULL COMMENT ' event_hash ' ,
56- ` contract_address` varchar (42 ) NOT NULL COMMENT ' contract_address ' ,
57- ` data` json NOT NULL COMMENT ' data ' ,
58- ` status` varchar (32 ) NOT NULL COMMENT ' status ' ,
59- ` retry_count` bigint DEFAULT ' 0 ' COMMENT ' retry_count ' ,
41+ ` id` bigint NOT NULL AUTO_INCREMENT,
42+ ` created_at` datetime DEFAULT CURRENT_TIMESTAMP ,
43+ ` updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
44+ ` sync_block_id` bigint NOT NULL ,
45+ ` blockchain` varchar (32 ) NOT NULL ,
46+ ` block_time` bigint NOT NULL ,
47+ ` block_number` bigint NOT NULL ,
48+ ` block_hash` varchar (66 ) NOT NULL ,
49+ ` block_log_indexed` bigint NOT NULL ,
50+ ` tx_index` bigint NOT NULL ,
51+ ` tx_hash` varchar (66 ) NOT NULL ,
52+ ` event_name` varchar (32 ) NOT NULL ,
53+ ` event_hash` varchar (66 ) NOT NULL ,
54+ ` contract_address` varchar (42 ) NOT NULL ,
55+ ` data` varchar ( 256 ) NOT NULL ,
56+ ` status` varchar (32 ) NOT NULL ,
57+ ` retry_count` bigint NOT NULL ,
6058 PRIMARY KEY (` id` ),
6159 KEY ` status_index` (` status` )
6260) ENGINE = InnoDB
63- AUTO_INCREMENT = 1011299
64- DEFAULT CHARSET = utf8mb4
65- COLLATE = utf8mb4_0900_ai_ci;
61+ AUTO_INCREMENT = 71494
62+ DEFAULT CHARSET = utf8mb3;
6663
6764
6865-- ----------------------------
6966-- Table structure for dispute_game
7067-- ----------------------------
71- DROP TABLE IF EXISTS dispute_game;
72- CREATE TABLE IF NOT EXISTS dispute_game
68+ DROP TABLE IF EXISTS ` dispute_game` ;
69+ CREATE TABLE ` dispute_game `
7370(
7471 ` id` bigint NOT NULL AUTO_INCREMENT,
75- ` created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
76- ` updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
77- ` sync_block_id` bigint NOT NULL COMMENT ' sync_block_id ' ,
78- ` blockchain` varchar (32 ) NOT NULL COMMENT ' blockchain ' ,
79- ` block_time` bigint NOT NULL COMMENT ' block_time ' ,
80- ` block_number` bigint NOT NULL COMMENT ' block_number ' ,
81- ` block_hash` varchar (66 ) NOT NULL COMMENT ' block_hash ' ,
82- ` block_log_indexed` bigint NOT NULL COMMENT ' block_log_indexed ' ,
83- ` tx_index` bigint NOT NULL COMMENT ' tx_index ' ,
84- ` tx_hash` varchar (66 ) NOT NULL COMMENT ' tx_hash ' ,
85- ` event_name` varchar (32 ) NOT NULL COMMENT ' event_name ' ,
86- ` event_hash` varchar (66 ) NOT NULL COMMENT ' event_hash ' ,
87- ` contract_address` varchar (42 ) NOT NULL COMMENT ' contract_address ' ,
72+ ` created_at` datetime DEFAULT CURRENT_TIMESTAMP ,
73+ ` updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
74+ ` sync_block_id` bigint NOT NULL ,
75+ ` blockchain` varchar (32 ) NOT NULL ,
76+ ` block_time` bigint NOT NULL ,
77+ ` block_number` bigint NOT NULL ,
78+ ` block_hash` varchar (66 ) NOT NULL ,
79+ ` block_log_indexed` bigint NOT NULL ,
80+ ` tx_index` bigint NOT NULL ,
81+ ` tx_hash` varchar (66 ) NOT NULL ,
82+ ` event_name` varchar (32 ) NOT NULL ,
83+ ` event_hash` varchar (66 ) NOT NULL ,
84+ ` contract_address` varchar (42 ) NOT NULL ,
8885 ` game_contract` varchar (42 ) NOT NULL ,
8986 ` game_type` int NOT NULL ,
9087 ` l2_block_number` bigint NOT NULL ,
91- ` status` int NOT NULL ,
92- ` computed` tinyint (1 ) NOT NULL DEFAULT 0 COMMENT ' 1-already get game credit 0- not yet' ,
88+ ` status` tinyint NOT NULL ,
89+ ` computed` tinyint (1 ) NOT NULL DEFAULT ' 0' ,
90+ ` calculate_lost` tinyint (1 ) NOT NULL DEFAULT ' 0' ,
91+ ` on_chain_status` varchar (32 ) NOT NULL DEFAULT ' valid' ,
92+ ` claim_data_len` bigint NOT NULL DEFAULT ' 1' ,
93+ ` get_len_status` tinyint (1 ) NOT NULL DEFAULT ' 0' ,
9394 PRIMARY KEY (` id` ),
9495 KEY ` status_index` (` status` ),
95- KEY ` dispute_game_index` (` contract_address` , ` game_contract` )
96- );
96+ KEY ` dispute_game_index` (` contract_address` , ` game_contract` ),
97+ KEY ` dispute_on_chain_status_index` (` on_chain_status` ),
98+ KEY ` dispute_claim_data_len_index` (` claim_data_len` )
99+ ) ENGINE = InnoDB
100+ AUTO_INCREMENT = 35578
101+ DEFAULT CHARSET = utf8mb3;
97102
98103-- ----------------------------
99104-- Table structure for game_claim_data
100105-- ----------------------------
101- DROP TABLE IF EXISTS game_claim_data;
102- CREATE TABLE IF NOT EXISTS game_claim_data
106+ DROP TABLE IF EXISTS ` game_claim_data` ;
107+ CREATE TABLE ` game_claim_data `
103108(
104- ` id` bigint NOT NULL AUTO_INCREMENT,
105- ` created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
106- ` updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
107- ` game_contract` varchar (42 ) NOT NULL ,
108- ` data_index` int NOT NULL ,
109- ` parent_index` bigint NOT NULL ,
110- ` countered_by` varchar (42 ) NOT NULL ,
111- ` claimant` varchar (64 ) NOT NULL ,
112- ` bond` bigint NOT NULL ,
113- ` claim` varchar (64 ) NOT NULL ,
114- ` position` bigint NOT NULL ,
115- ` clock` bigint NOT NULL ,
116- ` output_block` bigint NOT NULL ,
117- ` event_id` bigint NOT NULL ,
109+ ` id` bigint NOT NULL AUTO_INCREMENT,
110+ ` created_at` datetime DEFAULT CURRENT_TIMESTAMP ,
111+ ` updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
112+ ` game_contract` varchar (42 ) NOT NULL ,
113+ ` data_index` bigint NOT NULL ,
114+ ` parent_index` bigint NOT NULL ,
115+ ` countered_by` varchar (42 ) NOT NULL ,
116+ ` claimant` varchar (64 ) NOT NULL ,
117+ ` bond` varchar (128 ) NOT NULL ,
118+ ` claim` varchar (64 ) NOT NULL ,
119+ ` position` varchar (128 ) NOT NULL ,
120+ ` clock` varchar (128 ) NOT NULL ,
121+ ` output_block` bigint NOT NULL ,
122+ ` event_id` bigint NOT NULL ,
123+ ` on_chain_status` varchar (32 ) NOT NULL DEFAULT ' valid' ,
118124 PRIMARY KEY (` id` ),
119- KEY ` credit_index` (` game_contract` , ` data_index` )
120- );
125+ KEY ` claim_on_chain_status_index` (` on_chain_status` )
126+ ) ENGINE = InnoDB
127+ AUTO_INCREMENT = 36273
128+ DEFAULT CHARSET = utf8mb3;
121129
122130-- ----------------------------
123131-- Table structure for game_credit
124132-- ----------------------------
125- DROP TABLE IF EXISTS game_credit;
126- CREATE TABLE IF NOT EXISTS game_credit
133+ DROP TABLE IF EXISTS ` game_credit` ;
134+ CREATE TABLE ` game_credit `
127135(
128- ` id` bigint NOT NULL AUTO_INCREMENT,
129- ` created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
130- ` updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
131- ` game_contract` varchar (42 ) NOT NULL ,
132- ` address` varchar (64 ) NOT NULL ,
133- ` credit` bigint NOT NULL ,
136+ ` id` bigint NOT NULL AUTO_INCREMENT,
137+ ` created_at` datetime DEFAULT CURRENT_TIMESTAMP ,
138+ ` updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
139+ ` game_contract` varchar (42 ) NOT NULL ,
140+ ` address` varchar (64 ) NOT NULL ,
141+ ` credit` bigint NOT NULL ,
134142 PRIMARY KEY (` id` )
135- );
143+ ) ENGINE = InnoDB
144+ AUTO_INCREMENT = 36342
145+ DEFAULT CHARSET = utf8mb3;
136146
137147-- ----------------------------
138148-- Table structure for game_credit
139149-- ----------------------------
140- DROP TABLE IF EXISTS game_lost_bond ;
141- CREATE TABLE IF NOT EXISTS game_lost_bond
150+ DROP TABLE IF EXISTS ` game_lost_bonds ` ;
151+ CREATE TABLE ` game_lost_bonds `
142152(
143- ` id` bigint NOT NULL AUTO_INCREMENT,
144- ` created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
145- ` updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
146- ` game_contract` varchar (42 ) NOT NULL ,
147- ` address` varchar (64 ) NOT NULL ,
148- ` bond` bigint NOT NULL ,
153+ ` id` bigint NOT NULL AUTO_INCREMENT,
154+ ` created_at` datetime DEFAULT CURRENT_TIMESTAMP ,
155+ ` updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
156+ ` game_contract` varchar (42 ) NOT NULL ,
157+ ` address` varchar (64 ) NOT NULL ,
158+ ` bond` varchar ( 128 ) NOT NULL ,
149159 PRIMARY KEY (` id` )
150- )
160+ ) ENGINE = InnoDB
161+ AUTO_INCREMENT = 14080
162+ DEFAULT CHARSET = utf8mb3;
0 commit comments