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:
@@ -7,6 +7,7 @@ import {
|
||||
type PhonesMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type FileOutput } from 'src/engine/api/common/common-args-processors/data-arg-processor/types/file-item.type';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
@@ -42,7 +43,9 @@ export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
phone: string | null;
|
||||
phones: PhonesMetadata;
|
||||
city: string | null;
|
||||
/** @deprecated Use `avatarFile` field instead */
|
||||
avatarUrl: string | null;
|
||||
avatarFile: FileOutput[] | null;
|
||||
position: number;
|
||||
createdBy: ActorMetadata;
|
||||
updatedBy: ActorMetadata;
|
||||
|
||||
Reference in New Issue
Block a user