 INNER JOIN data_alerts T47 ON T297.id = T47.view_id
 LEFT JOIN hist_views T92 ON T297.id = T92.view_id
 INNER JOIN http_requests T97 ON T297.view_url = T97.currentsheet
-LEFT JOIN next_gen_permissions T120 ON T297.id = T120.authorizable_id AND next_gen_permissions.authorizable_type = 'View'
+LEFT JOIN next_gen_permissions T120 ON T297.id = T120.authorizable_id AND T120.authorizable_type = 'View'
 INNER JOIN sheet_images T251 ON T297.id = T251.view_id
 INNER JOIN user_default_customized_views T284 ON T297.id = T284.view_id
 INNER JOIN view_metrics_aggregations T293 ON T297.id = T293.view_id

INNER JOIN domains T60 ON T78.domain_id = T60.id
INNER JOIN sites T259 ON T78.site_id = T259.id
LEFT JOIN hist_groups T84 ON T78.id = T84.group_id
LEFT JOIN next_gen_permissions T120 ON T78.id = T120.grantee_id AND next_gen_permissions.next_gen_permissions.grantee_type = 'Group'
LEFT JOIN permissions_templates T126 ON T78.id = T126.grantee_id AND permissions_templates.grantee_type = 'Group'
---------------------------------------------------
-- Table hist_capabilities

LEFT JOIN extracts T68 ON T55.id = T68.datasource_id
LEFT JOIN hist_datasources T83 ON T55.id = T83.datasource_id
LEFT JOIN most_recent_refreshes T116 ON T55.id = T116.datasource_id
LEFT JOIN next_gen_permissions T120 ON T55.id = T120.authorizable_id AND T120.authorizable_type = 'Datasource'
INNER JOIN _datasources_stats T5 ON T55.id = T5.datasource_id
---------------------------------------------------
-- Table deleted_objects
