Replies: 2 comments
-
Since composite primary keys are not really supported, could you provide an example project to recreate this issue and the type of sql query you would like the Or better yet, make a PR that adds the suggested where conditions to the query and then we can debate if it is backwards compatible. |
Beta Was this translation helpful? Give feedback.
-
@totop275 @AndrewMast This project can be used also for testing. |
Beta Was this translation helpful? Give feedback.
-
Laravel Version
11.44.0
PHP Version
8.3.15
Database Driver & Version
mysql:5.7 (docker image)
Description
When using Laravel’s updateOrCreate with a where condition that includes multiple columns, the update process still only relies on the model’s primaryKey, instead of considering all the where columns provided.
Example:
In this example:
Impact:
Expected Behavior:
Steps To Reproduce
Doing updateOrCreate on a model for table that has composit primary key or no primary key
Beta Was this translation helpful? Give feedback.
All reactions