Skip to content

Commit

Permalink
use MIN instead of ANY_VALUE, as latter is available only in PostgreS…
Browse files Browse the repository at this point in the history
…QL 16
  • Loading branch information
toy committed Oct 14, 2024
1 parent e95c8d5 commit 552033d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/custom_field/order_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def group_by_statement
def group_by_select_statement
return unless field_format == "list"

"ANY_VALUE(cf_order_#{id}.ids)"
# MIN needed to not add this column to group by, ANY_VALUE can be used when
# minimum required PostgreSQL becomes 16
"MIN(cf_order_#{id}.ids)"
end

# Returns the join statement that is required to group objects by their value
Expand Down

0 comments on commit 552033d

Please sign in to comment.