mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 14:37:44 +01:00
Modify unique constraint of table harbor_label in pgsql (#4811)
Add unique constraint to column name, scope and project_id of table harbor_label to make creating same name labels under different projects valid
This commit is contained in:
parent
413ae9a8cb
commit
fa8bbe821a
@ -309,7 +309,7 @@ create table harbor_label (
|
||||
creation_time timestamp default 'now'::timestamp,
|
||||
update_time timestamp default 'now'::timestamp,
|
||||
PRIMARY KEY(id),
|
||||
CONSTRAINT unique_name_and_scope UNIQUE (name,scope)
|
||||
CONSTRAINT unique_label UNIQUE (name,scope, project_id)
|
||||
);
|
||||
|
||||
CREATE TRIGGER harbor_label_update_time_at_modtime BEFORE UPDATE ON harbor_label FOR EACH ROW EXECUTE PROCEDURE update_update_time_at_column();
|
||||
|
Loading…
Reference in New Issue
Block a user