Skip to content

Commit

Permalink
fix: remove unused pg indexes (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Feb 20, 2024
1 parent 449d6de commit 94d98d4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions migrations/1708471015438_remove-unused-indexes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;

export function up(pgm: MigrationBuilder): void {
pgm.dropIndex('locations', ['prev_output']);
pgm.dropIndex('locations', ['address']);
pgm.dropIndex('current_locations', ['block_height']);
pgm.dropIndex('brc20_mints', ['address']);
pgm.dropIndex('brc20_mints', ['block_height']);
pgm.dropIndex('brc20_mints', ['brc20_deploy_id']);
pgm.dropIndex('brc20_transfers', ['to_address']);
pgm.dropIndex('brc20_transfers', ['from_address']);
pgm.dropIndex('brc20_transfers', ['brc20_deploy_id']);
pgm.dropIndex('brc20_transfers', ['block_height']);
pgm.dropIndex('brc20_deploys', ['address']);
pgm.dropIndex('brc20_deploys', ['block_height']);
pgm.dropIndex('inscription_recursions', ['ref_inscription_genesis_id']);
}

export function down(pgm: MigrationBuilder): void {
pgm.createIndex('locations', ['prev_output']);
pgm.createIndex('locations', ['address']);
pgm.createIndex('current_locations', ['block_height']);
pgm.createIndex('brc20_mints', ['address']);
pgm.createIndex('brc20_mints', ['block_height']);
pgm.createIndex('brc20_mints', ['brc20_deploy_id']);
pgm.createIndex('brc20_transfers', ['to_address']);
pgm.createIndex('brc20_transfers', ['from_address']);
pgm.createIndex('brc20_transfers', ['brc20_deploy_id']);
pgm.createIndex('brc20_transfers', ['block_height']);
pgm.createIndex('brc20_deploys', ['address']);
pgm.createIndex('brc20_deploys', ['block_height']);
pgm.createIndex('inscription_recursions', ['ref_inscription_genesis_id']);
}

0 comments on commit 94d98d4

Please sign in to comment.