perf: add missing indexes on all foreign key columns (#2461)

This commit is contained in:
fallenbagel
2026-02-16 21:36:55 +05:00
committed by GitHub
parent 6076878f76
commit c6bcfe0ae4
10 changed files with 394 additions and 3 deletions

View File

@@ -521,12 +521,14 @@ export class MediaRequest {
eager: true,
onDelete: 'CASCADE',
})
@Index()
public media: Media;
@ManyToOne(() => User, (user) => user.requests, {
eager: true,
onDelete: 'CASCADE',
})
@Index()
public requestedBy: User;
@ManyToOne(() => User, {
@@ -535,6 +537,7 @@ export class MediaRequest {
eager: true,
onDelete: 'SET NULL',
})
@Index()
public modifiedBy?: User;
@DbAwareColumn({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })