Skip to content

Commit

Permalink
db: Improve hierarchy orderin of stat_for_unit
Browse files Browse the repository at this point in the history
  • Loading branch information
jhf committed Oct 22, 2024
1 parent b773a7c commit 3f6bbcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbseed/create-db-structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6119,7 +6119,7 @@ CREATE OR REPLACE FUNCTION public.stat_for_unit_hierarchy(
OR parent_legal_unit_id IS NOT NULL AND sfu.legal_unit_id = parent_legal_unit_id
)
AND sfu.valid_after < valid_on AND valid_on <= sfu.valid_to
ORDER BY sd.code
ORDER BY sd.priority ASC NULLS LAST, sd.code
), data_list AS (
SELECT jsonb_agg(data) AS data FROM ordered_data
)
Expand Down

0 comments on commit 3f6bbcf

Please sign in to comment.