diff --git a/make/common/db/registry.sql b/make/common/db/registry.sql index 0f7038c0e..b2baec91e 100644 --- a/make/common/db/registry.sql +++ b/make/common/db/registry.sql @@ -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 ( diff --git a/make/common/db/registry_sqlite.sql b/make/common/db/registry_sqlite.sql index 280745567..02961b706 100644 --- a/make/common/db/registry_sqlite.sql +++ b/make/common/db/registry_sqlite.sql @@ -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) ); diff --git a/tools/migration/changelog.md b/tools/migration/changelog.md index a0851ebe1..ac279b560 100644 --- a/tools/migration/changelog.md +++ b/tools/migration/changelog.md @@ -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` \ No newline at end of file