feat: configure standard views and migrate attachment seeds to FILES field (#17958)
## Summary
- Add default visible view fields for `timelineActivity`, `attachment`,
`noteTarget`, `taskTarget`, and `workspaceMember` objects so they
display useful columns out of the box
- Standardize morph relation field labels to "Target" with
`IconArrowUpRight` for consistency across all pivot/junction tables
- Mark deprecated fields (`fullPath`, `fileCategory`,
`linkedRecordCachedName`, `linkedRecordId`, `linkedObjectMetadataId`) as
`isSystem` to hide them from the UI column picker
- Fix morph field deduplication logic (`pickMorphGroupSurvivor`) to
prefer active, non-system fields over auto-generated system fields from
custom objects
- Migrate attachment seeds from legacy `fullPath`/`fileCategory` to the
new `FILES` field type, creating proper `FileEntity` records in
`core.file` via `fileStorageService.writeFile()`
- Restore `customDomain` in the user query fragment
<img width="825" height="754" alt="Screenshot 2026-02-15 at 15 44 27"
src="https://github.com/user-attachments/assets/9596a3dd-8d3a-43c0-925a-0adef9ee68a8"
/>
<img width="736" height="731" alt="Screenshot 2026-02-15 at 15 44 13"
src="https://github.com/user-attachments/assets/cd1a66c5-731d-43e6-bbc3-703cbeda1652"
/>
<img width="722" height="757" alt="Screenshot 2026-02-15 at 15 44 03"
src="https://github.com/user-attachments/assets/b5210546-6a40-4940-8e4f-874818a614fb"
/>
<img width="907" height="757" alt="Screenshot 2026-02-15 at 15 43 52"
src="https://github.com/user-attachments/assets/ead5b9a8-1989-4d68-9640-583da6233711"
/>
<img width="1002" height="731" alt="Screenshot 2026-02-15 at 15 43 38"
src="https://github.com/user-attachments/assets/38accb8c-f5d5-4bfc-b245-06389849810b"
/>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches migration/upgrade commands that write to core metadata tables
and adjust field/view definitions, plus changes dev seeding to create
`core.file` records; mistakes could affect UI visibility or seed
integrity across workspaces.
>
> **Overview**
> Adds a new `upgrade:1-18:backfill-standard-views-and-field-metadata`
command that, per workspace, marks specific fields as `isSystem`,
normalizes morph-relation field `label`/`icon` to
`Target`/`IconArrowUpRight`, and backfills missing standard
`view`/`viewField` rows for `attachment`, `noteTarget`, `taskTarget`,
`timelineActivity`, and `workspaceMember`, followed by cache
invalidation + metadata version bump.
>
> Refactors morph-relation deduplication to pick a single survivor per
`morphId` using a new `pickMorphGroupSurvivor` rule (prefer active +
non-system, then smallest id), with new unit tests.
>
> Updates standard metadata generators and snapshots to reflect the new
system flags and default view fields, and rewrites attachment dev
seeding to populate the new `file` (FILES field) JSON and create
corresponding `core.file` entries via `FileStorageService.writeFile`
with workspace-scoped file IDs.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b1939bbf6f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor
claude[bot] <41898282+claude[bot]@users.noreply.github.com>
parent
b80146c890
commit
c775d65952
@@ -80,6 +80,46 @@ export const STANDARD_OBJECTS = {
|
||||
universalIdentifier: '14d0f5a9-6c81-4e3b-5f2a-8d9e0c1b2f36',
|
||||
},
|
||||
},
|
||||
views: {
|
||||
allAttachments: {
|
||||
universalIdentifier: '3f7f3363-7087-44cc-902d-5e8904262316',
|
||||
viewFields: {
|
||||
name: {
|
||||
universalIdentifier: 'be56712f-d7a6-4fbe-b92b-d750f0708a0a',
|
||||
},
|
||||
file: {
|
||||
universalIdentifier: '873cf114-5477-4b62-9023-7ea6ad69fbe5',
|
||||
},
|
||||
createdBy: {
|
||||
universalIdentifier: 'fa363372-0fdf-4bb3-bdf1-0ead354b9225',
|
||||
},
|
||||
createdAt: {
|
||||
universalIdentifier: '6c092c26-b1cb-488f-ae2e-5af4bec1162b',
|
||||
},
|
||||
targetPerson: {
|
||||
universalIdentifier: '73a4c3a7-c7f9-4ed6-a2b6-117d7efad0f3',
|
||||
},
|
||||
targetCompany: {
|
||||
universalIdentifier: 'b335ad04-059e-4c36-8666-f40431849044',
|
||||
},
|
||||
targetOpportunity: {
|
||||
universalIdentifier: '15f2d457-dc09-4c52-bf2a-47083d6bf017',
|
||||
},
|
||||
targetTask: {
|
||||
universalIdentifier: 'c2913c5e-6cc6-438d-9c2f-3212a9b2a82b',
|
||||
},
|
||||
targetNote: {
|
||||
universalIdentifier: 'fc8dba49-bcf2-41b8-a435-0c4a3bbf2af6',
|
||||
},
|
||||
targetDashboard: {
|
||||
universalIdentifier: 'bcc6d6e1-7c0b-4291-9270-66e42024d8dd',
|
||||
},
|
||||
targetWorkflow: {
|
||||
universalIdentifier: '11fcf58b-dbab-42dd-be67-689462111070',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
blocklist: {
|
||||
universalIdentifier: '20202020-0408-4f38-b8a8-4d5e3e26e24d',
|
||||
@@ -1152,6 +1192,28 @@ export const STANDARD_OBJECTS = {
|
||||
universalIdentifier: '2527a2b6-3558-4f0c-2a9b-56e7f58e9e57',
|
||||
},
|
||||
},
|
||||
views: {
|
||||
allNoteTargets: {
|
||||
universalIdentifier: 'd124d587-ef78-402b-9341-7673e6cea033',
|
||||
viewFields: {
|
||||
id: {
|
||||
universalIdentifier: 'f2d912fe-7c6f-4a9c-b808-b7b5a18d2818',
|
||||
},
|
||||
note: {
|
||||
universalIdentifier: '9d4ac173-d32b-4a44-9dbd-8a47ab844f98',
|
||||
},
|
||||
targetPerson: {
|
||||
universalIdentifier: 'b6f67de5-c5cf-4235-b740-a6a007c8eae3',
|
||||
},
|
||||
targetCompany: {
|
||||
universalIdentifier: 'a9c7f370-4b22-4f29-8e3f-678e91a59576',
|
||||
},
|
||||
targetOpportunity: {
|
||||
universalIdentifier: '3efeb162-cd03-458b-9c7b-47032d045204',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opportunity: {
|
||||
universalIdentifier: '20202020-9549-49dd-b2b2-883999db8938',
|
||||
@@ -1716,6 +1778,28 @@ export const STANDARD_OBJECTS = {
|
||||
universalIdentifier: '5850b5c9-6881-4a3d-5b2c-89f0a81f2f80',
|
||||
},
|
||||
},
|
||||
views: {
|
||||
allTaskTargets: {
|
||||
universalIdentifier: '1dbf1d24-6cca-4f55-ae2f-e3d1b425a495',
|
||||
viewFields: {
|
||||
id: {
|
||||
universalIdentifier: 'a49287c9-8aa6-4fca-9ec5-08d643f7239f',
|
||||
},
|
||||
task: {
|
||||
universalIdentifier: '1f79839e-42f6-4a69-839a-369e21a7497d',
|
||||
},
|
||||
targetPerson: {
|
||||
universalIdentifier: 'cadc7a33-1527-4ef8-ac00-7ed0b54d1bae',
|
||||
},
|
||||
targetCompany: {
|
||||
universalIdentifier: 'e9fa1305-4ba2-41c5-9198-fdc622b69f90',
|
||||
},
|
||||
targetOpportunity: {
|
||||
universalIdentifier: '526f3354-34d6-4e7e-a870-5f99c28353c2',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
timelineActivity: {
|
||||
universalIdentifier: '20202020-6736-4337-b5c4-8b39fae325a5',
|
||||
@@ -1831,6 +1915,33 @@ export const STANDARD_OBJECTS = {
|
||||
linkedRecordCachedName: {
|
||||
universalIdentifier: '20202020-bf01-4b01-8b01-ba5cc01aa017',
|
||||
},
|
||||
targetPerson: {
|
||||
universalIdentifier: '37b38a8b-abd7-4f72-92d2-ad82bbef0296',
|
||||
},
|
||||
targetCompany: {
|
||||
universalIdentifier: '2015825f-0786-4b0d-88a7-dfce1b4b1c1a',
|
||||
},
|
||||
targetOpportunity: {
|
||||
universalIdentifier: 'f7b5ced9-eba6-4454-8849-7a92d27c11ca',
|
||||
},
|
||||
targetTask: {
|
||||
universalIdentifier: '3899138d-e6fa-414c-9432-214c9b797ebb',
|
||||
},
|
||||
targetNote: {
|
||||
universalIdentifier: 'ab74ed52-0195-4b65-987a-8367c07ee222',
|
||||
},
|
||||
targetWorkflow: {
|
||||
universalIdentifier: 'd2c3ddc3-afad-40b9-a2cb-d2765f2f5691',
|
||||
},
|
||||
targetWorkflowVersion: {
|
||||
universalIdentifier: '4a7e3213-afd5-4691-8bba-0a10e8697afb',
|
||||
},
|
||||
targetWorkflowRun: {
|
||||
universalIdentifier: '97910946-04f0-4634-804e-880bc0019225',
|
||||
},
|
||||
targetDashboard: {
|
||||
universalIdentifier: '538847e8-ab09-407c-a433-505f6d7be7a1',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2213,6 +2324,12 @@ export const STANDARD_OBJECTS = {
|
||||
createdAt: {
|
||||
universalIdentifier: '20202020-ef01-4e01-8e01-a0bcaeabe1f8',
|
||||
},
|
||||
ownedOpportunities: {
|
||||
universalIdentifier: '8a0503f3-ba61-453e-86dc-6c79f7bc235b',
|
||||
},
|
||||
assignedTasks: {
|
||||
universalIdentifier: 'af16226e-6375-4676-8bd9-9d1a57076fc4',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user