Skip to content

Commit b434beb

Browse files
committed
fix(server): uuids integrity
1 parent 66aed86 commit b434beb

File tree

4 files changed

+110
-109
lines changed

4 files changed

+110
-109
lines changed

packages/twenty-server/src/database/commands/upgrade-version-command/1-12/1-12-associate-standard-entities-to-twenty-standard-application.command.ts

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -79,38 +79,39 @@ export class AssociateStandardEntitiesToTwentyStandardApplicationCommand extends
7979
case 'fieldMetadata':
8080
case 'index':
8181
case 'objectMetadata': {
82-
const currentMetadataEntity =
83-
ALL_METADATA_ENTITY_BY_METADATA_NAME[metadataName];
84-
85-
const metadataEntityRepository =
86-
queryRunner.manager.getRepository(currentMetadataEntity);
87-
88-
const standardEntities = await metadataEntityRepository.find({
89-
select: {
90-
standardId: true,
91-
universalIdentifier: true,
92-
applicationId: true,
93-
id: true,
94-
},
95-
where: {
96-
standardId: Not(IsNull()),
97-
workspaceId,
98-
applicationId: IsNull(),
99-
},
100-
withDeleted: true,
101-
});
102-
103-
for (const entity of standardEntities) {
104-
this.logger.log(
105-
`Processing entity id=${entity.id} standardId=${entity.standardId}`,
106-
);
107-
108-
await metadataEntityRepository.update(entity.id, {
109-
universalIdentifier:
110-
entity.universalIdentifier ?? entity.standardId,
111-
applicationId: twentyStandardApplication.id,
112-
});
113-
}
82+
// Commented as should be migrated by the sync metadata
83+
// const currentMetadataEntity =
84+
// ALL_METADATA_ENTITY_BY_METADATA_NAME[metadataName];
85+
86+
// const metadataEntityRepository =
87+
// queryRunner.manager.getRepository(currentMetadataEntity);
88+
89+
// const standardEntities = await metadataEntityRepository.find({
90+
// select: {
91+
// standardId: true,
92+
// universalIdentifier: true,
93+
// applicationId: true,
94+
// id: true,
95+
// },
96+
// where: {
97+
// standardId: Not(IsNull()),
98+
// workspaceId,
99+
// applicationId: IsNull(),
100+
// },
101+
// withDeleted: true,
102+
// });
103+
104+
// for (const entity of standardEntities) {
105+
// this.logger.log(
106+
// `Processing entity id=${entity.id} standardId=${entity.standardId}`,
107+
// );
108+
109+
// await metadataEntityRepository.update(entity.id, {
110+
// universalIdentifier:
111+
// entity.universalIdentifier ?? entity.standardId,
112+
// applicationId: twentyStandardApplication.id,
113+
// });
114+
// }
114115
break;
115116
}
116117
case 'view': {

packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/views/companies-all.view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { msg } from '@lingui/core/macro';
2+
import { v4 } from 'uuid';
23

34
import { AggregateOperations } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant';
45
import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
@@ -11,7 +12,6 @@ import {
1112
} from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
1213
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
1314
import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object.constant';
14-
import { v4 } from 'uuid';
1515

1616
export const companiesAllView = ({
1717
objectMetadataItems,

packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export const BLOCKLIST_STANDARD_FIELD_IDS = {
7070
export const CALENDAR_CHANNEL_EVENT_ASSOCIATION_STANDARD_FIELD_IDS = {
7171
id: '20202020-c01a-4021-8a21-9edf06bfef0a',
7272
createdAt: '20202020-c01b-4022-9b22-afefd7cffefb',
73-
updatedAt: '20202020-c01c-4023-8c23-bffef8dffef0c',
74-
deletedAt: '20202020-c01d-4024-9d24-cffef9effef1d',
73+
updatedAt: '20202020-c01c-4023-8c23-bffef8dffef0',
74+
deletedAt: '20202020-c01d-4024-9d24-cffef9effef1',
7575
calendarChannel: '20202020-93ee-4da4-8d58-0282c4a9cb7d',
7676
calendarEvent: '20202020-5aa5-437e-bb86-f42d457783e3',
7777
eventExternalId: '20202020-9ec8-48bb-b279-21d0734a75a1',

0 commit comments

Comments
 (0)