Skip to content

[5.8] Fix qualified UPDATED_AT timestamps - #26997

Merged
taylorotwell merged 1 commit into
laravel:masterfrom
staudenmeir:update-timestamp
Dec 31, 2018
Merged

[5.8] Fix qualified UPDATED_AT timestamps#26997
taylorotwell merged 1 commit into
laravel:masterfrom
staudenmeir:update-timestamp

Conversation

@staudenmeir

@staudenmeir staudenmeir commented Dec 30, 2018

Copy link
Copy Markdown
Contributor

#26031 qualified UPDATED_AT timestamps to fix ambiguity issues.

This doesn't work properly when the attributes already contain an updated_at value:

User::first()->update(['name' => 'foo']);

In this case, Builder::addUpdatedAtColumn() returns an array with two separate updated_at values:

array:3 [▼
  "users.updated_at" => "2018-12-30 16:01:40"
  "name" => "foo"
  "updated_at" => "2018-12-30 16:01:40"
]

We have to merge the attributes first and then qualify the column by replacing the array key.

Fixes #26995.

@taylorotwell
taylorotwell merged commit a05eb4a into laravel:master Dec 31, 2018
@staudenmeir
staudenmeir deleted the update-timestamp branch December 31, 2018 10:29
@rennokki

rennokki commented Mar 8, 2019

Copy link
Copy Markdown
Contributor

ETA for the next patch?

@mfn

mfn commented Mar 8, 2019

Copy link
Copy Markdown
Contributor

Hmm, what for? This went straight into 5.8 which is already released?

@rennokki

rennokki commented Mar 8, 2019

Copy link
Copy Markdown
Contributor

My bad. I feel so stupid for not seeing that the PR got published in December 2018. So the MongoDB issues should be fixed within the MongoDB package.

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 participants