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

5.8.30 to 5.8.31 update on postgresql causes issue #29443

Closed
bryanrscott opened this issue Aug 7, 2019 · 3 comments · Fixed by #29448
Closed

5.8.30 to 5.8.31 update on postgresql causes issue #29443

bryanrscott opened this issue Aug 7, 2019 · 3 comments · Fixed by #29448

Comments

@bryanrscott
Copy link

bryanrscott commented Aug 7, 2019

  • Laravel Version: 5.8.31
  • PHP Version: 7.3
  • Postgresql (homestead or AWS)

Description:

When updating model with timestamps enabled, an exception is thrown.
Illuminate \ Database \ QueryException (42703)
SQLSTATE[42703]: Undefined column:
It looks to be thrown because the "updated_at" column in the sql is prefixed with the table name.

update "schema"."tablename" set "name" = CCCC, .....
"tablename"."updated_at" = 2019-08-07 04:20:58 where "id" = 1152

Steps To Reproduce:

in composer.json set "laravel/framework": "5.8.*" then run composer update

WORK AROUND

in composer.json set "laravel/framework": "5.8.30" then run composer update

@mfn
Copy link
Contributor

mfn commented Aug 7, 2019

From https://github.com/laravel/framework/releases/tag/v5.8.31 it seems [5.8] Fix UPDATE queries with alias fits the bill maybe? But not sure why it would.

I've also upgraded and didn't encounter this in my tests (~6k, lots of DB); can you please share the exact code producing this?

Still pinging @staudenmeir to the rescue ⛑

@jayked
Copy link

jayked commented Aug 7, 2019

#29448 Should fix this issue. Complete strings after the first . were used as a column which breaks when you are using schema references. In the pull request this has been changed by exploding the string on the . and use the latest item of the resulting array, which is the actual column.

@staudenmeir
Copy link
Contributor

Sorry about that.

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 a pull request may close this issue.

4 participants