Populate issues blocking_issues_count field
On !37368 (merged) we added blocking_issues_count
field to issues table.
Now we have to backfill issues that are blocking others and still have 0 value on the column.
This can be done with a background migration. I added the record count that needs to be updated below:
For BLOCKS link type
SELECT COUNT(*) FROM issue_links
LEFT OUTER JOIN issues ON issue_links.source_id = issues.id
WHERE issues.blocking_issues_count = 0 AND issue_links.link_type = 1
count
-------
12985
(1 row)
for IS_BLOCKED_BY link type
SELECT COUNT(*) FROM issue_links
LEFT OUTER JOIN issues ON issue_links.target_id = issues.id
WHERE issues.blocking_issues_count = 0 AND issue_links.link_type = 2
count
-------
33317
(1 row)
Edited by Felipe Artur