Skip to content

Commit

Permalink
Merge pull request #2131 from bcgov/fix/alex-hotfix-migration-250227
Browse files Browse the repository at this point in the history
HotFix: limit added to materialized view subqueries
  • Loading branch information
AlexZorkin authored Feb 28, 2025
2 parents 44a6ed1 + 432c14a commit bccdeff
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def upgrade() -> None:
FROM transfer_comment tc
WHERE tc.transfer_id = t.transfer_id
AND tc.comment_source = 'FROM_ORG'
LIMIT 1
) AS comment,
tc.category,
Expand All @@ -98,6 +99,7 @@ def upgrade() -> None:
FROM transfer_history th
WHERE th.transfer_id = t.transfer_id
AND th.transfer_status_id = 6 -- Recorded
LIMIT 1
) AS recorded_date,
NULL AS approved_date,
t.transaction_effective_date,
Expand Down Expand Up @@ -138,6 +140,7 @@ def upgrade() -> None:
FROM initiative_agreement_history iah
WHERE iah.initiative_agreement_id = ia.initiative_agreement_id
AND iah.initiative_agreement_status_id = 3 -- Approved
LIMIT 1
) AS approved_date,
ia.transaction_effective_date,
ia.update_date,
Expand Down Expand Up @@ -173,6 +176,7 @@ def upgrade() -> None:
FROM admin_adjustment_history aah
WHERE aah.admin_adjustment_id = aa.admin_adjustment_id
AND aah.admin_adjustment_status_id = 3 -- Approved
LIMIT 1
) AS approved_date,
aa.transaction_effective_date,
aa.update_date,
Expand Down

0 comments on commit bccdeff

Please sign in to comment.