harbor/make/migrations/postgresql/0002_1.7.0_schema.up.sql
Wenkai Yin 9d5cf57373 Check the existence of name when creating replication rule and fix bugs in testing library (#6381)
1. Fix #5102 by checking the existence of name when creating/editing replication rule
2. Add unique constraint to the name of replication policy and target
3. Fix bugs of testing library

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2018-11-30 13:32:20 +08:00

16 lines
500 B
SQL

ALTER TABLE properties ALTER COLUMN v TYPE varchar(1024);
DELETE FROM properties where k='scan_all_policy';
create table job_log (
log_id SERIAL NOT NULL,
job_uuid varchar (64) NOT NULL,
creation_time timestamp default CURRENT_TIMESTAMP,
content text,
primary key (log_id)
);
CREATE UNIQUE INDEX job_log_uuid ON job_log (job_uuid);
ALTER TABLE replication_policy ADD CONSTRAINT unique_policy_name UNIQUE (name);
ALTER TABLE replication_target ADD CONSTRAINT unique_target_name UNIQUE (name);