Identify standard objects (#17091)
# Introduction Followup https://github.com/twentyhq/twenty/pull/16981 1/ Migration, applicationId and universalIdentifier are required on entity ( save point migration + upgrade command fallback pattern ) 2/ Backfill using previous standard ids
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ export const getFlatObjectMetadataMock = (
|
||||
nameSingular: 'defaultflatObjectMetadataNameSingular',
|
||||
shortcut: 'shortcut',
|
||||
standardId: null,
|
||||
applicationId: null,
|
||||
applicationId: faker.string.uuid(),
|
||||
standardOverrides: null,
|
||||
targetTableName: '',
|
||||
workspaceId: faker.string.uuid(),
|
||||
|
||||
+5
-3
@@ -14,6 +14,11 @@ export const fromObjectMetadataEntityToFlatObjectMetadata = (
|
||||
|
||||
return {
|
||||
...objectMetadataEntityWithoutRelations,
|
||||
// TODO remove once MakeObjectMetadataUniversalIdentifierAndApplicationIdNotNullableMigrationCommand has been run once
|
||||
universalIdentifier:
|
||||
objectMetadataEntityWithoutRelations.universalIdentifier ??
|
||||
objectMetadataEntityWithoutRelations.standardId ??
|
||||
objectMetadataEntityWithoutRelations.id,
|
||||
createdAt: objectMetadataEntity.createdAt.toISOString(),
|
||||
updatedAt: objectMetadataEntity.updatedAt.toISOString(),
|
||||
viewIds: objectMetadataEntity.views.map((viewEntity) => viewEntity.id),
|
||||
@@ -23,8 +28,5 @@ export const fromObjectMetadataEntityToFlatObjectMetadata = (
|
||||
fieldMetadataIds: objectMetadataEntity.fields.map(
|
||||
(fieldEntity) => fieldEntity.id,
|
||||
),
|
||||
universalIdentifier:
|
||||
objectMetadataEntityWithoutRelations.standardId ??
|
||||
objectMetadataEntityWithoutRelations.id,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user