You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to update an entry in a collection with the primary key column set up as "manually entered string", the operation appears to succeed (directus shows no error) but the primary key column is not changed.
Create a collection test with the primary key field (id) set to "Manually entered string"
Create an entry in test, set id to foo
Edit the entry, change id to bar, click save
The entry appears to save successfully but the id of the entry is still foo (note if there are other fields in the entry, they are updated correctly)
I have no problems updating the primary key column of the same table with a regular SQL query like
UPDATE "test" SET id='bar' WHERE "id"='foo';
So it does not appear to be an issue/constraint with the database or schema.
I understand that directus may not want to allow updating primary keys for some internal reason, but I think in that case an error message should be show, as the current behaviour is confusing since the edit seems to succeed but does not
Directus Version
10.8.3
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered:
@br41nslug is there a reason to exclude pk while updating? or as a part of this fix should we allow updating PK as long as its not auto increment/generated
Thanks for opening this issue! However this is a duplicate of an existing issue #16472, so I'll proceed to close this but if you think this is actually a different issue, then please do not hesitate to comment. Otherwise you may subscribe to #16472 for future updates.
Per #16472 (comment) we do not allow updating the PK at this time for the reasons stated there.
Describe the Bug
When trying to update an entry in a collection with the primary key column set up as "manually entered string", the operation appears to succeed (directus shows no error) but the primary key column is not changed.
To Reproduce
test
with the primary key field (id) set to "Manually entered string"id
tofoo
id
tobar
, click savefoo
(note if there are other fields in the entry, they are updated correctly)I have no problems updating the primary key column of the same table with a regular SQL query like
So it does not appear to be an issue/constraint with the database or schema.
I understand that directus may not want to allow updating primary keys for some internal reason, but I think in that case an error message should be show, as the current behaviour is confusing since the edit seems to succeed but does not
Directus Version
10.8.3
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered: