-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add delete view fields without views command #8728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds commands to clean up orphaned view fields and enforce data integrity constraints, focusing on making viewId non-nullable and updating cascade behaviors.
Key changes:
- Added
DeleteViewFieldsWithoutViewsCommand
to remove view fields with null viewId - Changed
onDelete
action fromSET_NULL
toCASCADE
for viewFields inViewWorkspaceEntity
- Added unique index on
[fieldMetadataId, viewId]
inViewFieldWorkspaceEntity
- Added
onDelete: SET_NULL
action for favorites relation inFavoriteFolderWorkspaceEntity
- Made
viewId
field non-nullable inViewFieldWorkspaceEntity
8 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile
.../src/database/commands/upgrade-version/0-33/0-33-delete-view-fields-without-views.command.ts
Show resolved
Hide resolved
.../src/database/commands/upgrade-version/0-33/0-33-delete-view-fields-without-views.command.ts
Show resolved
Hide resolved
.../src/database/commands/upgrade-version/0-33/0-33-delete-view-fields-without-views.command.ts
Show resolved
Hide resolved
await this.deleteViewFieldsWithoutViewsCommand.executeActiveWorkspacesCommand( | ||
passedParam, | ||
options, | ||
workspaceIds, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding error handling here to prevent upgrade failure if view field cleanup fails
...enty-server/src/modules/favorite-folder/standard-objects/favorite-folder.workspace-entity.ts
Show resolved
Hide resolved
## Context We recently added a command to ensure uniqueness on the viewId column in the viewField table. This created some issues for some old workspaces that had viewFields with an empty viewId. This command should get rid of those and set the column as non-nullable. Also updating the onDelete action accordingly and set one missing for FavoriteFolder
Context
We recently added a command to ensure uniqueness on the viewId column in the viewField table. This created some issues for some old workspaces that had viewFields with an empty viewId.
This command should get rid of those and set the column as non-nullable.
Also updating the onDelete action accordingly and set one missing for FavoriteFolder