Make sure the revision of execution isn't null during the upgrade (#14085)

Make sure the revision of execution isn't null during the upgrade
Fixes #14075

Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
Wenkai Yin(尹文开) 2021-01-27 10:10:36 +08:00 committed by GitHub
parent 9574f8c3c6
commit 50a1e85095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -519,6 +519,9 @@ CREATE TABLE IF NOT EXISTS "report_vulnerability_record" (
CONSTRAINT fk_report_uuid FOREIGN KEY(report_uuid) REFERENCES scan_report(uuid) ON DELETE CASCADE
);
/*make sure the revision of execution isn't null*/
UPDATE execution SET revision=0 WHERE revision IS NULL;
/*delete the retention execution records whose policy doesn't exist*/
DELETE FROM retention_execution
WHERE id IN (SELECT re.id FROM retention_execution re