Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/notifications/migrations/AddNotificationCompositeIndex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner, TableIndex } from 'typeorm';

export class AddNotificationCompositeIndex1700000000000 implements MigrationInterface {
name = 'AddNotificationCompositeIndex1700000000000';

async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createIndex(
'notifications',
new TableIndex({
name: 'IDX_notifications_user_type_status_created',
columnNames: ['userId', 'type', 'status', 'createdAt'],
}),
);
}

async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropIndex('notifications', 'IDX_notifications_user_type_status_created');
}
}
Loading