fix: relation on self not working (#2875)

This commit is contained in:
Jérémy M 2023-12-08 12:06:31 +01:00 committed by GitHub
parent 326b29b699
commit 63196f866f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,7 @@ export class RelationMetadataService extends TypeOrmQueryService<RelationMetadat
const createdFieldMap = createdFields.reduce((acc, fieldMetadata) => {
if (fieldMetadata.type === FieldMetadataType.RELATION) {
acc[fieldMetadata.objectMetadataId] = fieldMetadata;
acc[fieldMetadata.name] = fieldMetadata;
}
return acc;
@ -176,8 +176,8 @@ export class RelationMetadataService extends TypeOrmQueryService<RelationMetadat
const createdRelationMetadata = await super.createOne({
...record,
fromFieldMetadataId: createdFieldMap[record.fromObjectMetadataId].id,
toFieldMetadataId: createdFieldMap[record.toObjectMetadataId].id,
fromFieldMetadataId: createdFieldMap[record.fromName].id,
toFieldMetadataId: createdFieldMap[record.toName].id,
});
await this.workspaceMigrationService.createCustomMigration(