Skip to content

[5.8] Fix Eloquent UPDATE queries with alias - #28607

Merged
taylorotwell merged 1 commit into
laravel:5.8from
staudenmeir:update-alias
May 25, 2019
Merged

[5.8] Fix Eloquent UPDATE queries with alias#28607
taylorotwell merged 1 commit into
laravel:5.8from
staudenmeir:update-alias

Conversation

@staudenmeir

Copy link
Copy Markdown
Contributor

#26031 qualified UPDATED_AT timestamps to fix ambiguity issues.

This doesn't work when the query uses an alias:

User::from('users as alias')->update(['foo' => 'bar']);

update `users` as `alias` set `foo` = bar, `users`.`updated_at` = 2019-05-24 20:12:50
                                            ^^^^^

Fixes #28569.

@taylorotwell
taylorotwell merged commit 9c21900 into laravel:5.8 May 25, 2019
@staudenmeir
staudenmeir deleted the update-alias branch May 26, 2019 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[5.8] Query builder Increment/Decrement method when using table alias throws unknown column error for timestamps

2 participants