Missing index with job_id, when query task with job_id, it cause a full table scan, caused performance issue
Fixes#15271
Signed-off-by: stonezdj <stonezdj@gmail.com>
From harbor 2.4, the trivy does not support scan report v1.0, we need to remove the old version scan reports from the DB.
Signed-off-by: He Weiwei <hweiwei@vmware.com>