Skip to content

Commit cf6dfa3

Browse files
authored
Adding note about upsert to Eloquent page (#7746)
1 parent de971e4 commit cf6dfa3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eloquent.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ If you would like to perform multiple "upserts" in a single query, then you shou
761761
['departure' => 'Oakland', 'destination' => 'San Diego', 'price' => 99],
762762
['departure' => 'Chicago', 'destination' => 'New York', 'price' => 150]
763763
], ['departure', 'destination'], ['price']);
764+
765+
> {note} All databases except SQL Server require the columns in the second argument of the `upsert` method to have a "primary" or "unique" index. In addition, the MySQL database driver ignores the second argument of the `upsert` method and always uses the "primary" and "unique" indexes of the table to detect existing records.
764766
765767
<a name="deleting-models"></a>
766768
## Deleting Models

0 commit comments

Comments
 (0)