diff --git a/src/database/migrations/1727258557893-create-index-event-logs.ts b/src/database/migrations/1727258557893-create-index-event-logs.ts new file mode 100644 index 0000000..496fa16 --- /dev/null +++ b/src/database/migrations/1727258557893-create-index-event-logs.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner, TableIndex } from 'typeorm'; + +export class CreateIndexEventLogs1727258557893 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createIndex( + 'event_logs', + new TableIndex({ + name: 'index-tx-hash-lock', + columnNames: ['tx_hash_lock'], + isUnique: true, + }), + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropIndex('event_logs', 'index-tx-hash-lock'); + } +}