Unverified Commit 4a97cd27 authored by Wenkai Yin(尹文开)'s avatar Wenkai Yin(尹文开) Committed by GitHub
Browse files

Merge pull request #11038 from ywk253100/200312_upgrade

Repair the count usage during the upgrading 
parents 37e6fa5c a4a19135
Showing with 8 additions and 3 deletions
+8 -3
......@@ -98,6 +98,14 @@ FROM (
) AS s
WHERE artifact.digest=s.digest;
/*repair the count usage as we calculate the count quota against artifact rather than tag*/
/*count=count-(tag count-artifact count)*/
UPDATE quota_usage SET used=jsonb_set(used, '{count}', ((used->>'count')::int - (SELECT (
SELECT COUNT (*) FROM tag
JOIN artifact ON tag.artifact_id=artifact.id
WHERE artifact.project_id=quota_usage.reference_id::int)-(
SELECT COUNT (*) FROM artifact
WHERE project_id=quota_usage.reference_id::int)))::text::jsonb);
/* artifact_reference records the child artifact referenced by parent artifact */
CREATE TABLE artifact_reference
......
......@@ -66,9 +66,6 @@ func Migrate(database *models.Database) error {
return err
}
// update quota
// TODO
return nil
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment