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 non-partial inserts for models with composite identity primary keys #51859

Merged
merged 1 commit into from
May 27, 2024

Conversation

fatkodima
Copy link
Member

Fixes #51821.

When doing non-partial inserts, we should ignore not only unchanged columns with a default function, but also which are autoincremented in the database (and so don't have a default function).

@yahonda yahonda merged commit ae3c93d into rails:main May 27, 2024
3 checks passed
yahonda added a commit to yahonda/rails that referenced this pull request May 27, 2024
…h-identity-cpk

Fix non-partial inserts for models with composite identity primary keys
yahonda added a commit to yahonda/rails that referenced this pull request May 27, 2024
…h-identity-cpk

Fix non-partial inserts for models with composite identity primary keys
@yahonda
Copy link
Member

yahonda commented May 27, 2024

Backported these two stable branches:

@fatkodima fatkodima deleted the fix-partial_inserts-with-identity-cpk branch May 27, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Activerecord: Insert fails on composed_primary_key model with id as not null Identity column
3 participants