Skip to content

Commit

Permalink
fix: create unique indexes for views for concurrent refresh (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr authored Jun 30, 2023
1 parent 2078613 commit 58123cb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions migrations/1688153654886_concurrent-view-indexes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* 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.createIndex('chain_tip', ['block_height'], { unique: true });
pgm.createIndex('mime_type_counts', ['mime_type'], { unique: true });
pgm.createIndex('sat_rarity_counts', ['sat_rarity'], { unique: true });
pgm.createIndex('inscription_count', ['count'], { unique: true });
}

0 comments on commit 58123cb

Please sign in to comment.