mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 06:28:06 +01:00
Merge pull request #12896 from wy65701436/fixes-12889
fix migration issue
This commit is contained in:
commit
1b8bec3994
@ -9,6 +9,13 @@ Fixes https://github.com/goharbor/harbor/issues/12827
|
|||||||
resolve it.
|
resolve it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Delete the duplicate tags if user re-tag & re-push the missing images */
|
||||||
|
DELETE FROM tag
|
||||||
|
WHERE id NOT IN
|
||||||
|
(SELECT MAX(id) AS id
|
||||||
|
FROM (SELECT t.*, art.repository_name FROM artifact AS art JOIN tag AS t ON art.id = t.artifact_id) t1
|
||||||
|
GROUP BY t1.name, t1.repository_name);
|
||||||
|
|
||||||
/* Insert the missing repository records */
|
/* Insert the missing repository records */
|
||||||
INSERT INTO repository (name, project_id)
|
INSERT INTO repository (name, project_id)
|
||||||
SELECT DISTINCT repository_name, project_id FROM artifact WHERE repository_id<0 AND
|
SELECT DISTINCT repository_name, project_id FROM artifact WHERE repository_id<0 AND
|
||||||
|
Loading…
Reference in New Issue
Block a user