Send also workflows as part of unified jobs

Workflows do not have a record in main_job, therefore the JOIN
was ignoring those. We need to do LEFT JOIN to include also
workflows.

It also seems like we are not able to get a link to organizations
from workflows? When looking at:
<tower_url>#/organizations?organization_search=page_size:20;order_by:name

We don't seem to list a relation to workflows. Is it possible to get it from
somewhere?
This commit is contained in:
Ladislav Smola 2020-03-05 14:49:49 +01:00
parent b7227113be
commit 6a503e152a

View File

@ -276,7 +276,7 @@ def copy_tables(since, full_path):
main_unifiedjob.instance_group_id
FROM main_unifiedjob
JOIN django_content_type ON main_unifiedjob.polymorphic_ctype_id = django_content_type.id
JOIN main_organization ON main_organization.id = main_unifiedjob.organization_id
LEFT JOIN main_organization ON main_organization.id = main_unifiedjob.organization_id
WHERE main_unifiedjob.modified > {}
AND main_unifiedjob.launch_type != 'sync'
ORDER BY main_unifiedjob.id ASC) TO STDOUT WITH CSV HEADER'''.format(since.strftime("'%Y-%m-%d %H:%M:%S'"))