-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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] Fix ambiguous UPDATED_AT columns #26031
Conversation
Great work! 😁 |
@driesvints Is there anyway to get this merged into 5.7? I understand that because 5.5 is LTS it gets fixed, but it would be nice to let the current stable version get the fix too? |
I'm afraid it's not possible, as the change to |
@mfn Thanks for the feedback. It is interesting that 5.5 was able to be patched without breaking it, but that the current stable 5.7 cannot be patched. I appreciate you taking the time to answer. |
@jimmypuckett Are you referring to #26022? We had to revert it in #26024. |
We remove table prefix that was added in laravel/framework#26031
#13519 attempted to fix ambiguous
UPDATED_AT
columns inJOIN
queries:If both tables have an
updated_at
column, you get an "ambiguous column name" error (on MySQL).To fix this, the previous PR qualified the column with the table name. This didn't work because PostgreSQL and SQLite don't allow qualified columns in
UPDATE
queries (#13707).#22366 updated the
SQLiteGrammar
to remove the table name from qualified columns when anUPDATE
query is compiled. This PR applies the same behavior to thePostgresGrammar
.We can now safely qualify the column on all platforms. We have to replace
Arr::add()
witharray_merge()
because the former interprets a qualified column as a nested key.$values
is the second argument so that the users can override theupdated_at
value (as they can now).Fixes #13909.