delete foreign key

This commit is contained in:
Wenkai Yin 2017-05-10 18:28:19 +08:00
parent c3c7b540f1
commit 1e28f01365
3 changed files with 3 additions and 5 deletions

View File

@ -107,8 +107,7 @@ create table access_log (
operation varchar(20) NOT NULL,
op_time timestamp,
primary key (log_id),
INDEX pid_optime (project_id, op_time),
FOREIGN KEY (project_id) REFERENCES project (project_id)
INDEX pid_optime (project_id, op_time)
);
create table repository (

View File

@ -102,8 +102,7 @@ create table access_log (
repo_tag varchar (128),
GUID varchar(64),
operation varchar(20) NOT NULL,
op_time timestamp,
FOREIGN KEY (project_id) REFERENCES project (project_id)
op_time timestamp
);
CREATE INDEX pid_optime ON access_log (project_id, op_time);
@ -117,7 +116,6 @@ create table repository (
star_count int DEFAULT 0 NOT NULL,
creation_time timestamp default CURRENT_TIMESTAMP,
update_time timestamp default CURRENT_TIMESTAMP,
FOREIGN KEY (project_id) REFERENCES project(project_id),
UNIQUE (name)
);

View File

@ -43,4 +43,5 @@ Changelog for harbor database schema
- delete column `owner_id` from table `repository`
- delete column `user_id` from table `access_log`
- delete foreign key (user_id) references user(user_id)from table `access_log`
- delete foreign key (project_id) references project(project_id)from table `access_log`
- add column `username` varchar (32) to table `access_log`