Fix sync metadata default value not being synced (#9163)

## Context
We used to not sync defaultValue and recently introduced a change in
3340f01c31/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/comparators/workspace-field.comparator.ts
with shouldNotOverrideDefaultValue to sync it for specific field
metadata type that can't be overwritten by the user.
This means we should have removed 'defaultValue' from
commonFieldPropertiesToIgnore list since it was handled differently.
This PR fixes that

Before
<img width="792" alt="Screenshot 2024-12-20 at 11 04 09"
src="https://github.com/user-attachments/assets/1771c5a3-2162-4013-8a08-c54d2619fda3"
/>

After
<img width="798" alt="Screenshot 2024-12-20 at 11 04 55"
src="https://github.com/user-attachments/assets/33e09f16-c615-4a43-950d-d2df955fb196"
/>
This commit is contained in:
Weiko 2024-12-20 11:42:42 +01:00 committed by GitHub
parent 1acf845101
commit 779c503381
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 8 deletions

View File

@ -9,7 +9,7 @@ import { RecordPositionBackfillService } from 'src/engine/api/graphql/workspace-
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
@Command({
name: 'migrate-0.40:backfill-record-position',
name: 'upgrade-0.40:record-position-backfill',
description: 'Backfill record position',
})
export class RecordPositionBackfillCommand extends ActiveWorkspacesCommandRunner {

View File

@ -38,6 +38,12 @@ export class UpgradeTo0_40Command extends ActiveWorkspacesCommandRunner {
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail',
);
await this.recordPositionBackfillCommand.executeActiveWorkspacesCommand(
passedParam,
options,
workspaceIds,
);
await this.phoneCallingCodeCreateColumnCommand.executeActiveWorkspacesCommand(
passedParam,
options,
@ -50,12 +56,6 @@ export class UpgradeTo0_40Command extends ActiveWorkspacesCommandRunner {
workspaceIds,
);
await this.recordPositionBackfillCommand.executeActiveWorkspacesCommand(
passedParam,
options,
workspaceIds,
);
await this.viewGroupNoValueBackfillCommand.executeActiveWorkspacesCommand(
passedParam,
options,

View File

@ -26,7 +26,6 @@ const commonFieldPropertiesToIgnore = [
'gate',
'asExpression',
'generatedType',
'defaultValue',
'isLabelSyncedWithName',
];