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',
|
||||
})
|
||||
@JoinColumn({ name: 'objectMetadataId' })
|
||||
@Index('IndexOnObjectMetadataId')
|
||||
object: Relation<ObjectMetadataEntity>;
|
||||
|
||||
@Column({
|
||||
@ -97,6 +98,7 @@ export class FieldMetadataEntity<
|
||||
isUnique: boolean;
|
||||
|
||||
@Column({ nullable: false, type: 'uuid' })
|
||||
@Index('IndexOnWorkspaceId')
|
||||
workspaceId: string;
|
||||
|
||||
@Column({ default: false })
|
||||
|
||||
@ -2,6 +2,7 @@ import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
@ -31,6 +32,7 @@ export class IndexFieldMetadataEntity {
|
||||
indexMetadata: Relation<IndexMetadataEntity>;
|
||||
|
||||
@Column({ nullable: false })
|
||||
@Index('IndexOnFieldMetadataId')
|
||||
fieldMetadataId: string;
|
||||
|
||||
@ManyToOne(
|
||||
|
||||
@ -146,7 +146,7 @@ export class CleanerWorkspaceService {
|
||||
`Sending ${workspace.id} ${
|
||||
workspace.displayName
|
||||
} suspended since ${daysSinceInactive} days emails to users ['${workspaceMembers
|
||||
.map((workspaceUser) => workspaceUser.id)
|
||||
.map((workspaceUser) => workspaceUser.userId)
|
||||
.join(', ')}']`,
|
||||
);
|
||||
|
||||
@ -199,7 +199,7 @@ export class CleanerWorkspaceService {
|
||||
`Sending workspace ${workspace.id} ${
|
||||
workspace.displayName
|
||||
} deletion emails to users ['${workspaceMembers
|
||||
.map((workspaceUser) => workspaceUser.id)
|
||||
.map((workspaceUser) => workspaceUser.userId)
|
||||
.join(', ')}']`,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user