mirror of
https://github.com/goharbor/harbor
synced 2024-09-21 00:29:56 +00:00
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:
commit
f885de0913
|
@ -287,7 +287,7 @@ create table harbor_resource_label (
|
||||||
creation_time timestamp default CURRENT_TIMESTAMP,
|
creation_time timestamp default CURRENT_TIMESTAMP,
|
||||||
update_time timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
update_time timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||||
PRIMARY KEY(id),
|
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` (
|
CREATE TABLE IF NOT EXISTS `alembic_version` (
|
||||||
|
|
|
@ -281,7 +281,7 @@ create table harbor_resource_label (
|
||||||
resource_type char(1) NOT NULL,
|
resource_type char(1) NOT NULL,
|
||||||
creation_time timestamp default CURRENT_TIMESTAMP,
|
creation_time timestamp default CURRENT_TIMESTAMP,
|
||||||
update_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 (
|
create table alembic_version (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user