All files / src/Projection/migrations 1726479765002-nft-metadata-index.ts

80% Statements 4/5
100% Branches 0/0
50% Functions 1/2
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  35x   35x 35x     2x                  
import { MigrationInterface, QueryRunner } from 'typeorm';
import { NftMetadataEntity } from '@cardano-sdk/projection-typeorm';
 
export class NftMetadataIndexMigration1726479765002 implements MigrationInterface {
  static entity = NftMetadataEntity;
 
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      'CREATE INDEX "IDX_nft_metadata_user_token_asset_id" ON "nft_metadata" ("user_token_asset_id") '
    );
  }
 
  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query('DROP INDEX "public"."IDX_nft_metadata_user_token_asset_id"');
  }
}