Conversation
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
2 similar comments
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| starred: boolean | ||
| isPrivate?: boolean | ||
| ssoUserId?: string | null | ||
| logoUrl?: string | null |
There was a problem hiding this comment.
createCollection SQL ignores new columns
High Severity
The ICreateCollection interface now accepts isPrivate, ssoUserId, and logoUrl, and the migration adds these columns to the database, but the createCollection function's hardcoded INSERT statement on line 139 only includes name, description, slug, categoryId, starred. Any values passed for the new fields will be silently dropped, so community collections can never be created with the correct ssoUserId or isPrivate flag.
Additional Locations (1)
|
|
||
| CREATE INDEX "ix_collectionsRepositories_collectionId" | ||
| ON public."collectionsRepositories" ("collectionId") | ||
| WHERE "deletedAt" IS NULL; |
There was a problem hiding this comment.
Missing unique index on collectionsRepositories for active records
Medium Severity
The collectionsRepositories table lacks a partial unique index on (collectionId, repoId) WHERE deletedAt IS NULL, unlike the collectionLikes table which correctly has one on (collectionId, ssoUserId). Without this constraint, the same repository can be actively linked to the same collection multiple times, leading to duplicate data.


Note
Medium Risk
Medium risk because it introduces new tables and foreign keys and alters
collections, which can impact existing data/migrations and query expectations if not deployed in the right order.Overview
Introduces new DB migrations for community collections: adds
isPrivate,ssoUserId, andlogoUrlcolumns tocollections, createsinsightsSsoUsers, and wires a FK fromcollections.ssoUserIdwithON DELETE SET NULL.Adds join/interaction tables
collectionsRepositories(with soft-delete and an index on active rows) andcollectionLikes(soft-delete plus a partial unique index to enforce one active like per user/collection), and provides a down migration that drops these tables/columns/constraint.Updates the data-access-layer
collectionstypes/enums to includeisPrivate,ssoUserId, andlogoUrlas queryable fields.Written by Cursor Bugbot for commit 6bc38d8. This will update automatically on new commits. Configure here.