@@ -51,7 +51,8 @@ pub async fn drop_consume_info_table(tx: &mut RBatisTxExecutor<'_>) -> () {}
51
51
52
52
#[ sql(
53
53
tx,
54
- "CREATE TABLE mercury_live_cell(
54
+ "
55
+ CREATE TABLE mercury_live_cell(
55
56
id bigint PRIMARY KEY,
56
57
tx_hash bytea NOT NULL,
57
58
output_index int NOT NULL,
@@ -71,20 +72,33 @@ pub async fn drop_consume_info_table(tx: &mut RBatisTxExecutor<'_>) -> () {}
71
72
type_args bytea,
72
73
type_script_type smallint,
73
74
data bytea
74
- )"
75
+ );
76
+ CREATE INDEX \" index_live_cell_table_block_hash\" ON \" mercury_live_cell\" (\" block_hash\" );
77
+ CREATE INDEX \" index_live_cell_table_block_number\" ON \" mercury_live_cell\" (\" block_number\" );
78
+ CREATE INDEX \" index_live_cell_table_tx_hash_and_output_index\" ON \" mercury_live_cell\" (\" tx_hash\" , \" output_index\" );
79
+ CREATE INDEX \" index_live_cell_table_lock_hash\" ON \" mercury_live_cell\" (\" lock_hash\" );
80
+ CREATE INDEX \" index_live_cell_table_lock_code_hash_and_lock_script_type\" ON \" mercury_live_cell\" (\" lock_code_hash\" , \" lock_script_type\" );
81
+ CREATE INDEX \" index_live_cell_table_type_code_hash_and_type_script_type\" ON \" mercury_live_cell\" (\" type_code_hash\" , \" type_script_type\" );
82
+ "
75
83
) ]
76
84
pub async fn create_live_cell_table ( tx : & mut RBatisTxExecutor < ' _ > ) -> ( ) { }
77
85
78
86
#[ sql(
79
87
tx,
80
- "CREATE TABLE mercury_script(
88
+ "
89
+ CREATE TABLE mercury_script(
81
90
script_hash bytea NOT NULL PRIMARY KEY,
82
91
script_hash_160 bytea NOT NULL,
83
92
script_code_hash bytea NOT NULL,
84
93
script_args bytea,
85
94
script_type smallint NOT NULL,
86
95
script_args_len int
87
- );"
96
+ );
97
+ CREATE INDEX \" index_script_table_script_hash\" ON \" mercury_script\" (\" script_hash\" );
98
+ CREATE INDEX \" index_script_table_code_hash\" ON \" mercury_script\" (\" script_code_hash\" );
99
+ CREATE INDEX \" index_script_table_args\" ON \" mercury_script\" (\" script_args\" );
100
+ CREATE INDEX \" index_script_table_script_hash_160\" ON \" mercury_script\" USING btree (\" script_hash_160\" );
101
+ " ,
88
102
) ]
89
103
pub async fn create_script_table ( tx : & mut RBatisTxExecutor < ' _ > ) -> ( ) { }
90
104
0 commit comments