Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 94d98d4

Browse files
authored
fix: remove unused pg indexes (#311)
1 parent 449d6de commit 94d98d4

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
3+
4+
export const shorthands: ColumnDefinitions | undefined = undefined;
5+
6+
export function up(pgm: MigrationBuilder): void {
7+
pgm.dropIndex('locations', ['prev_output']);
8+
pgm.dropIndex('locations', ['address']);
9+
pgm.dropIndex('current_locations', ['block_height']);
10+
pgm.dropIndex('brc20_mints', ['address']);
11+
pgm.dropIndex('brc20_mints', ['block_height']);
12+
pgm.dropIndex('brc20_mints', ['brc20_deploy_id']);
13+
pgm.dropIndex('brc20_transfers', ['to_address']);
14+
pgm.dropIndex('brc20_transfers', ['from_address']);
15+
pgm.dropIndex('brc20_transfers', ['brc20_deploy_id']);
16+
pgm.dropIndex('brc20_transfers', ['block_height']);
17+
pgm.dropIndex('brc20_deploys', ['address']);
18+
pgm.dropIndex('brc20_deploys', ['block_height']);
19+
pgm.dropIndex('inscription_recursions', ['ref_inscription_genesis_id']);
20+
}
21+
22+
export function down(pgm: MigrationBuilder): void {
23+
pgm.createIndex('locations', ['prev_output']);
24+
pgm.createIndex('locations', ['address']);
25+
pgm.createIndex('current_locations', ['block_height']);
26+
pgm.createIndex('brc20_mints', ['address']);
27+
pgm.createIndex('brc20_mints', ['block_height']);
28+
pgm.createIndex('brc20_mints', ['brc20_deploy_id']);
29+
pgm.createIndex('brc20_transfers', ['to_address']);
30+
pgm.createIndex('brc20_transfers', ['from_address']);
31+
pgm.createIndex('brc20_transfers', ['brc20_deploy_id']);
32+
pgm.createIndex('brc20_transfers', ['block_height']);
33+
pgm.createIndex('brc20_deploys', ['address']);
34+
pgm.createIndex('brc20_deploys', ['block_height']);
35+
pgm.createIndex('inscription_recursions', ['ref_inscription_genesis_id']);
36+
}

0 commit comments

Comments
 (0)