diff --git a/make/photon/db/registry.sql b/make/photon/db/registry.sql index 111ca6232..b59694c27 100644 --- a/make/photon/db/registry.sql +++ b/make/photon/db/registry.sql @@ -287,7 +287,7 @@ create table harbor_resource_label ( creation_time timestamp default CURRENT_TIMESTAMP, update_time timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY(id), - CONSTRAINT unique_label_resource UNIQUE (label_id,resource_id, resource_type) + CONSTRAINT unique_label_resource UNIQUE (label_id,resource_id, resource_name, resource_type) ); CREATE TABLE IF NOT EXISTS `alembic_version` ( diff --git a/make/photon/db/registry_sqlite.sql b/make/photon/db/registry_sqlite.sql index 82d0be64c..40490a4f7 100644 --- a/make/photon/db/registry_sqlite.sql +++ b/make/photon/db/registry_sqlite.sql @@ -281,7 +281,7 @@ create table harbor_resource_label ( resource_type char(1) NOT NULL, creation_time timestamp default CURRENT_TIMESTAMP, update_time timestamp default CURRENT_TIMESTAMP, - UNIQUE (label_id,resource_id, resource_type) + UNIQUE (label_id,resource_id,resource_name,resource_type) ); create table alembic_version (