fix: add index to authenticators table

This commit is contained in:
Antonella Sgarlatta
2026-09-08 15:44:26 -03:00
committed by Antonella Sgarlatta
parent 9eb2b22c6e
commit fd5ca2e101
3 changed files with 28 additions and 1 deletions
@@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddAuthenticatorsUserUuidIndex1778037105000 implements MigrationInterface {
name = 'AddAuthenticatorsUserUuidIndex1778037105000'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('CREATE INDEX `index_authenticators_on_user_uuid` ON `authenticators` (`user_uuid`)')
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('DROP INDEX `index_authenticators_on_user_uuid` ON `authenticators`')
}
}
@@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddAuthenticatorsUserUuidIndex1778037105000 implements MigrationInterface {
name = 'AddAuthenticatorsUserUuidIndex1778037105000'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('CREATE INDEX "index_authenticators_on_user_uuid" ON "authenticators" ("user_uuid")')
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query('DROP INDEX "index_authenticators_on_user_uuid"')
}
}
@@ -1,4 +1,4 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm'
@Entity({ name: 'authenticators' })
export class TypeORMAuthenticator {
@@ -9,6 +9,7 @@ export class TypeORMAuthenticator {
name: 'user_uuid',
length: 36,
})
@Index('index_authenticators_on_user_uuid')
declare userUuid: string
@Column({