Skip to content

Commit f4413fe

Browse files
committed
Change the address index of the CCCChanges table
The current address index is not used in the query for the balance history of an address.
1 parent 57b7deb commit f4413fe

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict";
2+
3+
const TABLE_NAME = "CCCChanges";
4+
module.exports = {
5+
up: async (queryInterface, Sequelize) => {
6+
await queryInterface.removeIndex(TABLE_NAME, "ccc_changes_address");
7+
await queryInterface.addIndex(
8+
TABLE_NAME,
9+
["address", "blockNumber", "id"],
10+
{
11+
name: "ccc_changes_address_block_number_id",
12+
unique: true
13+
}
14+
);
15+
},
16+
17+
down: async (queryInterface, Sequelize) => {
18+
await queryInterface.removeIndex(
19+
TABLE_NAME,
20+
"ccc_changes_address_block_number_id"
21+
);
22+
await queryInterface.addIndex(TABLE_NAME, ["address"], {
23+
name: "ccc_changes_address",
24+
unique: false
25+
});
26+
}
27+
};

0 commit comments

Comments
 (0)