fix log + add 3 indexes on fielMetadata and indexFieldMetadata (#10113)
This commit is contained in:
@ -0,0 +1,25 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class AddIndexesOnFieldMetadataAndIndexFieldMetadata1739203246456
|
||||||
|
implements MigrationInterface
|
||||||
|
{
|
||||||
|
name = 'AddIndexesOnFieldMetadataAndIndexMetadata1739203246456';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`CREATE INDEX "IndexOnFieldMetadataId" ON "metadata"."indexFieldMetadata" ("fieldMetadataId") `,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`CREATE INDEX "IndexOnObjectMetadataId" ON "metadata"."fieldMetadata" ("objectMetadataId") `,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`CREATE INDEX "IndexOnWorkspaceId" ON "metadata"."fieldMetadata" ("workspaceId") `,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`DROP INDEX "metadata"."IndexOnWorkspaceId"`);
|
||||||
|
await queryRunner.query(`DROP INDEX "metadata"."IndexOnObjectMetadataId"`);
|
||||||
|
await queryRunner.query(`DROP INDEX "metadata"."IndexOnFieldMetadataId"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -52,6 +52,7 @@ export class FieldMetadataEntity<
|
|||||||
onDelete: 'CASCADE',
|
onDelete: 'CASCADE',
|
||||||
})
|
})
|
||||||
@JoinColumn({ name: 'objectMetadataId' })
|
@JoinColumn({ name: 'objectMetadataId' })
|
||||||
|
@Index('IndexOnObjectMetadataId')
|
||||||
object: Relation<ObjectMetadataEntity>;
|
object: Relation<ObjectMetadataEntity>;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
@ -97,6 +98,7 @@ export class FieldMetadataEntity<
|
|||||||
isUnique: boolean;
|
isUnique: boolean;
|
||||||
|
|
||||||
@Column({ nullable: false, type: 'uuid' })
|
@Column({ nullable: false, type: 'uuid' })
|
||||||
|
@Index('IndexOnWorkspaceId')
|
||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
|
|
||||||
@Column({ default: false })
|
@Column({ default: false })
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import {
|
|||||||
Column,
|
Column,
|
||||||
CreateDateColumn,
|
CreateDateColumn,
|
||||||
Entity,
|
Entity,
|
||||||
|
Index,
|
||||||
JoinColumn,
|
JoinColumn,
|
||||||
ManyToOne,
|
ManyToOne,
|
||||||
PrimaryGeneratedColumn,
|
PrimaryGeneratedColumn,
|
||||||
@ -31,6 +32,7 @@ export class IndexFieldMetadataEntity {
|
|||||||
indexMetadata: Relation<IndexMetadataEntity>;
|
indexMetadata: Relation<IndexMetadataEntity>;
|
||||||
|
|
||||||
@Column({ nullable: false })
|
@Column({ nullable: false })
|
||||||
|
@Index('IndexOnFieldMetadataId')
|
||||||
fieldMetadataId: string;
|
fieldMetadataId: string;
|
||||||
|
|
||||||
@ManyToOne(
|
@ManyToOne(
|
||||||
|
|||||||
@ -146,7 +146,7 @@ export class CleanerWorkspaceService {
|
|||||||
`Sending ${workspace.id} ${
|
`Sending ${workspace.id} ${
|
||||||
workspace.displayName
|
workspace.displayName
|
||||||
} suspended since ${daysSinceInactive} days emails to users ['${workspaceMembers
|
} suspended since ${daysSinceInactive} days emails to users ['${workspaceMembers
|
||||||
.map((workspaceUser) => workspaceUser.id)
|
.map((workspaceUser) => workspaceUser.userId)
|
||||||
.join(', ')}']`,
|
.join(', ')}']`,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ export class CleanerWorkspaceService {
|
|||||||
`Sending workspace ${workspace.id} ${
|
`Sending workspace ${workspace.id} ${
|
||||||
workspace.displayName
|
workspace.displayName
|
||||||
} deletion emails to users ['${workspaceMembers
|
} deletion emails to users ['${workspaceMembers
|
||||||
.map((workspaceUser) => workspaceUser.id)
|
.map((workspaceUser) => workspaceUser.userId)
|
||||||
.join(', ')}']`,
|
.join(', ')}']`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user