Migrate noteTarget and taskTarget to Morph. (#17476)
This PR migrates `noteTarget` and `taskTarget` to morph relations behind separate feature flags, following the Attachment/TimelineActivity pattern. It introduces the `IS_NOTE_TARGET_MIGRATED` and `IS_TASK_TARGET_MIGRATED` flags, updates standard field metadata and indexes to use morph relations, and adds two **1.17 workspace migrations** that: - rename `noteTarget.*Id` / `taskTarget.*Id` columns to `target*Id` - convert the corresponding field metadata to `MORPH_RELATION` with a shared `morphId` On the frontend, note/task target read and write paths switch to `target*Id` when the respective flag is enabled. Deleted targets are filtered on reload to prevent reappearing relations.
This commit is contained in:
+6
-6
@@ -9,11 +9,11 @@ import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/
|
||||
export class NoteTargetWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
note: EntityRelation<NoteWorkspaceEntity> | null;
|
||||
noteId: string | null;
|
||||
person: EntityRelation<PersonWorkspaceEntity> | null;
|
||||
personId: string | null;
|
||||
company: EntityRelation<CompanyWorkspaceEntity> | null;
|
||||
companyId: string | null;
|
||||
opportunity: EntityRelation<OpportunityWorkspaceEntity> | null;
|
||||
opportunityId: string | null;
|
||||
targetPerson: EntityRelation<PersonWorkspaceEntity> | null;
|
||||
targetPersonId: string | null;
|
||||
targetCompany: EntityRelation<CompanyWorkspaceEntity> | null;
|
||||
targetCompanyId: string | null;
|
||||
targetOpportunity: EntityRelation<OpportunityWorkspaceEntity> | null;
|
||||
targetOpportunityId: string | null;
|
||||
custom: EntityRelation<CustomWorkspaceEntity>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user