Add deletedAt to foreignKey indexes (#7133)
We had to remove soft-deletion on default filters due to the missing indexes. We now generate composite indexes with the foreign key containing the deletedAt column as well which should improve performances
This commit is contained in:
@ -38,9 +38,9 @@ export function WorkspaceIndex(
|
||||
metadataArgsStorage.addIndexes({
|
||||
name: `IDX_${generateDeterministicIndexName([
|
||||
convertClassNameToObjectMetadataName(target.constructor.name),
|
||||
propertyKey.toString(),
|
||||
...[propertyKey.toString(), 'deletedAt'],
|
||||
])}`,
|
||||
columns: [propertyKey.toString()],
|
||||
columns: [propertyKey.toString(), 'deletedAt'],
|
||||
target: target.constructor,
|
||||
gate,
|
||||
});
|
||||
|
||||
@ -79,6 +79,7 @@ export class EntitySchemaColumnFactory {
|
||||
nullable: fieldMetadata.isNullable,
|
||||
createDate: key === 'createdAt',
|
||||
updateDate: key === 'updatedAt',
|
||||
deleteDate: key === 'deletedAt',
|
||||
array: fieldMetadata.type === FieldMetadataType.MULTI_SELECT,
|
||||
default: defaultValue,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user