fix: sync metadata shouldn't remove non custom fields (#3750)
* fix: sync metadata shouldn't remove non custom fields * fix: filter out custom relations
This commit is contained in:
@ -43,7 +43,11 @@ export class WorkspaceSyncObjectMetadataService {
|
||||
// Retrieve object metadata collection from DB
|
||||
const originalObjectMetadataCollection =
|
||||
await objectMetadataRepository.find({
|
||||
where: { workspaceId: context.workspaceId, isCustom: false },
|
||||
where: {
|
||||
workspaceId: context.workspaceId,
|
||||
isCustom: false,
|
||||
fields: { isCustom: false },
|
||||
},
|
||||
relations: ['dataSource', 'fields'],
|
||||
});
|
||||
|
||||
|
||||
@ -44,7 +44,11 @@ export class WorkspaceSyncRelationMetadataService {
|
||||
// Retrieve object metadata collection from DB
|
||||
const originalObjectMetadataCollection =
|
||||
await objectMetadataRepository.find({
|
||||
where: { workspaceId: context.workspaceId, isCustom: false },
|
||||
where: {
|
||||
workspaceId: context.workspaceId,
|
||||
isCustom: false,
|
||||
fields: { isCustom: false },
|
||||
},
|
||||
relations: ['dataSource', 'fields'],
|
||||
});
|
||||
|
||||
@ -58,10 +62,12 @@ export class WorkspaceSyncRelationMetadataService {
|
||||
);
|
||||
|
||||
// Retrieve relation metadata collection from DB
|
||||
// TODO: filter out custom relations once isCustom has been added to relationMetadata table
|
||||
const originalRelationMetadataCollection =
|
||||
await relationMetadataRepository.find({
|
||||
where: { workspaceId: context.workspaceId },
|
||||
where: {
|
||||
workspaceId: context.workspaceId,
|
||||
fromFieldMetadata: { isCustom: false },
|
||||
},
|
||||
});
|
||||
|
||||
// Create standard relation metadata collection
|
||||
|
||||
Reference in New Issue
Block a user