-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Fix compatibility with rails-head
when duplicated advisory lockable column
#1553
Conversation
The primary key and column may be identical. Current rails head will select this column twice, which confuses postgres
@@ -51,7 +51,7 @@ | |||
FROM "good_jobs" | |||
WHERE "good_jobs"."id" IN ( | |||
WITH "rows" AS #{'MATERIALIZED' if model_class.supports_cte_materialization_specifiers?} ( | |||
SELECT "good_jobs"."id", "good_jobs"."id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this expectation was wrong from the start. I don't think this would execute, same as in the issue
This looks like a great fix! Simple and definitely better now 🙇🏻 |
I think we may as well fix this in GoodJob. I'd like to make one tweak to see if I can avoid the array/uniq calculation because I think it would be marginally more efficient to do an |
Yeah, sure. You may also want to drop the |
I eventually plan to extract |
rails-head
rails-head
when duplicated advisory lockable column
The primary key and column may be identical. Current rails head will select this column twice, which confuses postgres.
Draft for now, let's first see how rails/rails#53747 goes.