Skip to content
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

fix(api): added support to update PK #21140

Closed
wants to merge 2 commits into from

Conversation

mahendraHegde
Copy link
Contributor

Scope

What's changed:

  • check if primary key is auto increment, if not allow to update primary key.

Potential Risks / Drawbacks

  • NA

Review Notes / Questions

  • does it make sense to allow updating all PKs? and then reset the auto increment?

Fixes #21101

Copy link

changeset-bot bot commented Jan 19, 2024

🦋 Changeset detected

Latest commit: 6631f6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ComfortablyCoding
Copy link
Contributor

Thanks for the PR, unfortunately this will allow updating the Primary Key for all Primary Key types (e.g. UUID etc) aside from auto increment. Additionally this does not address the issue of potentially breaking any Foreign Key that may be present.

As mentioned in #16472 (comment) at this time we are not allowing PK updates. Feel free to discuss potential solutions there to see what we can come up with to resolve the above issues.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unable to update primary key column, succeeds without error but no update applied
2 participants