Remove useless indexes (#12422)
As discussed with @charlesBochet - those indexes don't add any value
This commit is contained in:
@ -10,23 +10,9 @@ export class AddSoftDeleteIndexes1748844710107 implements MigrationInterface {
|
|||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`CREATE INDEX "IDX_USER_WORKSPACE_USER_ID" ON "core"."userWorkspace" ("userId") `,
|
`CREATE INDEX "IDX_USER_WORKSPACE_USER_ID" ON "core"."userWorkspace" ("userId") `,
|
||||||
);
|
);
|
||||||
await queryRunner.query(
|
|
||||||
`CREATE INDEX "IDX_USER_WORKSPACE_ID_DELETED_AT" ON "core"."userWorkspace" ("id", "deletedAt") `,
|
|
||||||
);
|
|
||||||
await queryRunner.query(
|
|
||||||
`CREATE INDEX "IDX_USER_ID_DELETED_AT" ON "core"."user" ("id", "deletedAt") `,
|
|
||||||
);
|
|
||||||
await queryRunner.query(
|
|
||||||
`CREATE INDEX "IDX_WORKSPACE_ID_DELETED_AT" ON "core"."workspace" ("id", "deletedAt") `,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
await queryRunner.query(`DROP INDEX "core"."IDX_WORKSPACE_ID_DELETED_AT"`);
|
|
||||||
await queryRunner.query(`DROP INDEX "core"."IDX_USER_ID_DELETED_AT"`);
|
|
||||||
await queryRunner.query(
|
|
||||||
`DROP INDEX "core"."IDX_USER_WORKSPACE_ID_DELETED_AT"`,
|
|
||||||
);
|
|
||||||
await queryRunner.query(`DROP INDEX "core"."IDX_USER_WORKSPACE_USER_ID"`);
|
await queryRunner.query(`DROP INDEX "core"."IDX_USER_WORKSPACE_USER_ID"`);
|
||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`DROP INDEX "core"."IDX_USER_WORKSPACE_WORKSPACE_ID"`,
|
`DROP INDEX "core"."IDX_USER_WORKSPACE_WORKSPACE_ID"`,
|
||||||
|
|||||||
@ -38,7 +38,6 @@ registerEnumType(PermissionsOnAllObjectRecords, {
|
|||||||
'userId',
|
'userId',
|
||||||
'workspaceId',
|
'workspaceId',
|
||||||
])
|
])
|
||||||
@Index('IDX_USER_WORKSPACE_ID_DELETED_AT', ['id', 'deletedAt'])
|
|
||||||
@Index('IDX_USER_WORKSPACE_USER_ID', ['userId'])
|
@Index('IDX_USER_WORKSPACE_USER_ID', ['userId'])
|
||||||
@Index('IDX_USER_WORKSPACE_WORKSPACE_ID', ['workspaceId'])
|
@Index('IDX_USER_WORKSPACE_WORKSPACE_ID', ['workspaceId'])
|
||||||
export class UserWorkspace {
|
export class UserWorkspace {
|
||||||
|
|||||||
@ -34,7 +34,6 @@ registerEnumType(OnboardingStatus, {
|
|||||||
unique: true,
|
unique: true,
|
||||||
where: '"deletedAt" IS NULL',
|
where: '"deletedAt" IS NULL',
|
||||||
})
|
})
|
||||||
@Index('IDX_USER_ID_DELETED_AT', ['id', 'deletedAt'])
|
|
||||||
export class User {
|
export class User {
|
||||||
@IDField(() => UUIDScalarType)
|
@IDField(() => UUIDScalarType)
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import {
|
|||||||
CreateDateColumn,
|
CreateDateColumn,
|
||||||
DeleteDateColumn,
|
DeleteDateColumn,
|
||||||
Entity,
|
Entity,
|
||||||
Index,
|
|
||||||
OneToMany,
|
OneToMany,
|
||||||
PrimaryGeneratedColumn,
|
PrimaryGeneratedColumn,
|
||||||
Relation,
|
Relation,
|
||||||
@ -35,7 +34,6 @@ registerEnumType(WorkspaceActivationStatus, {
|
|||||||
)
|
)
|
||||||
@Entity({ name: 'workspace', schema: 'core' })
|
@Entity({ name: 'workspace', schema: 'core' })
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
@Index('IDX_WORKSPACE_ID_DELETED_AT', ['id', 'deletedAt'])
|
|
||||||
export class Workspace {
|
export class Workspace {
|
||||||
// Fields
|
// Fields
|
||||||
@IDField(() => UUIDScalarType)
|
@IDField(() => UUIDScalarType)
|
||||||
|
|||||||
Reference in New Issue
Block a user