Merge pull request #4449 from ywk253100/180314_filter_by_label

Add unique constraint to columns label_id, resource_id, resource_name and resource_type in table harbor_resource_label
This commit is contained in:
Daniel Jiang 2018-03-21 18:37:04 +08:00 committed by GitHub
commit f885de0913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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` (

View File

@ -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 (