File - Migrate avatarUrl > avatarFile on person (data migration + logic) + Attachment data migration (#17752)
- Migration command
- Check IS_FILES_FIELD_MIGRATED:false
- Check or create avatarFile field
- Fetch all people with avatarUrl
- Move (Copy/move) file in storage
- Create core.file record
- Update person record
- bonus : attachment migration : fullPath > file (same logic)
- BE logic
- Add avatarFile field on person
- FE logic
- Adapt logic to upload on/display avatarFile data
The whole imageIdentifier logic will be done later
This commit is contained in:
+478
-475
File diff suppressed because it is too large
Load Diff
+21
@@ -229,6 +229,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
//deprecated
|
||||
avatarUrl: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
@@ -246,6 +247,26 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
avatarFile: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'avatarFile',
|
||||
type: FieldMetadataType.FILES,
|
||||
label: 'Avatar File',
|
||||
description: "Contact's avatar file",
|
||||
icon: 'IconFileUpload',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
settings: {
|
||||
maxNumberOfValues: 1,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
position: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
Reference in New Issue
Block a user