mirror of
https://github.com/goharbor/harbor
synced 2025-04-22 18:30:24 +00:00
update artifact_type column alteration (#20239)
update column if is null Signed-off-by: yminer <yminer@vmware.com> Co-authored-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
parent
c8370faeeb
commit
389a8c49f4
@ -20,12 +20,12 @@ table artifact:
|
|||||||
/*
|
/*
|
||||||
Add new column artifact_type for artifact table to work with oci-spec v1.1.0 list referrer api
|
Add new column artifact_type for artifact table to work with oci-spec v1.1.0 list referrer api
|
||||||
*/
|
*/
|
||||||
ALTER TABLE artifact ADD COLUMN artifact_type varchar(255);
|
ALTER TABLE artifact ADD COLUMN IF NOT EXISTS artifact_type varchar(255);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
set value for artifact_type
|
set value for artifact_type
|
||||||
then set column artifact_type as not null
|
then set column artifact_type as not null
|
||||||
*/
|
*/
|
||||||
UPDATE artifact SET artifact_type = media_type;
|
UPDATE artifact SET artifact_type = media_type WHERE artifact_type IS NULL;
|
||||||
|
|
||||||
ALTER TABLE artifact ALTER COLUMN artifact_type SET NOT NULL;
|
ALTER TABLE artifact ALTER COLUMN artifact_type SET NOT NULL;
|
Loading…
x
Reference in New Issue
Block a user