Skip to content

Commit

Permalink
feat: add index for tx_hash_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-TanHoang committed Sep 25, 2024
1 parent 83cfa9e commit f73e7cc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/database/migrations/1727258557893-create-index-event-logs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { MigrationInterface, QueryRunner, TableIndex } from 'typeorm';

export class CreateIndexEventLogs1727258557893 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createIndex(
'event_logs',
new TableIndex({
name: 'index-tx-hash-lock',
columnNames: ['tx_hash_lock'],
isUnique: true,
}),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropIndex('event_logs', 'index-tx-hash-lock');
}
}

0 comments on commit f73e7cc

Please sign in to comment.