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
Unable to update collection items with manually entered string primary keys #16472
Comments
I believe this is due to the primary key being filtered from the update payload. directus/api/src/services/items.ts Line 558 in 45eb494
I am wondering when should changes to IDs be allowed. |
Tricky.. When there's foreign keys in place to those primary keys, the database should ensure that the correct triggers are fired. That being said, there's most likely going to be databases that don't have foreign key constraints, in which case this might cause some serious issues if we don't reimplement foreign key checks in directus itself |
Linear: ENG-137 |
@rijkvanzanten are you planning to provide the ability to update manually entered primary keys, or has this feature/bug been forgotten? |
Eventually, yes! My comment above is still relevant: #16472 (comment) As of right now, we don't allow updating PKs (auto-increment integers, UUIDs, or otherwise) because of that comment.
Nope, it's an open issue 👍🏻 There hasn't been any activity on this issue (no upvotes or comments), so it's a lower priority for us |
Thank you, @rijkvanzanten !
Made more activity in the hope that you will reevaluate this issue :) |
Thank you! We're using this with key → value tables, e.g. for translations and would also welcome an improvement here. |
As I wrote in my closed issue:
|
@rijkvanzanten I was thinking, we have |
Describe the Bug
When we're updating the manually entered string as primary key of an item, it seems like the API request correctly sends the updated value, but the API response returns the old value:
chrome_BpF97sfBig.mp4
To Reproduce
Errors Shown
No errors are shown.
What version of Directus are you using?
9.20.4 (45eb494)
What version of Node.js are you using?
18.10.0
What database are you using?
Postgres 14
What browser are you using?
Chrome
How are you deploying Directus?
running locally in dev
The text was updated successfully, but these errors were encountered: