Skip to content

Commit

Permalink
Merge pull request #227 from sotatek-dev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sotatek-TanHoang authored Dec 27, 2024
2 parents a2e7054 + 5f2fd23 commit 3571faa
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner, TableIndex } from 'typeorm';

import { EEventStatus } from '../../constants/blockchain.constant.js';

export class AddEventLogStatusIndex1735289167820 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
return queryRunner.createIndex(
'event_logs',
new TableIndex({
columnNames: ['status'],
name: 'status_partial_index',
where: `status IN('${EEventStatus.WAITING}','${EEventStatus.PROCESSING}','${EEventStatus.FAILED}')`,
}),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
return queryRunner.dropIndex('event_logs', 'status_partial_index');
}
}

0 comments on commit 3571faa

Please sign in to comment.