diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service.ts index 4a0b758a787..9ec4d8cd388 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service.ts @@ -85,21 +85,17 @@ export class WorkspaceMigrationRunnerService { flatMapsKeysSet.has('flatRoleMaps') || flatMapsKeysSet.has('flatRoleTargetMaps'); - if (shouldIncrementMetadataGraphqlSchemaVersion) { - asyncOperations.push( - this.workspaceCacheService.invalidateAndRecompute(workspaceId, [ - 'ORMEntityMetadatas', - ]), - ); - } - - if (shouldInvalidateRoleMapCache) { + if ( + shouldIncrementMetadataGraphqlSchemaVersion || + shouldInvalidateRoleMapCache + ) { asyncOperations.push( this.workspaceCacheService.invalidateAndRecompute(workspaceId, [ 'rolesPermissions', 'userWorkspaceRoleMap', 'flatRoleTargetMaps', 'apiKeyRoleMap', + 'ORMEntityMetadatas', 'flatRoleTargetByAgentIdMaps', ]), );