diff --git a/make/photon/db/registry.sql b/make/photon/db/registry.sql index 8a4d1b5c8..b256bc3a4 100644 --- a/make/photon/db/registry.sql +++ b/make/photon/db/registry.sql @@ -199,7 +199,8 @@ create table replication_job ( update_time timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (id), INDEX policy (policy_id), - INDEX poid_uptime (policy_id, update_time) + INDEX poid_uptime (policy_id, update_time), + INDEX poid_status (policy_id, status) ); create table replication_immediate_trigger ( @@ -223,7 +224,11 @@ create table img_scan_job ( job_uuid varchar(64), creation_time timestamp default CURRENT_TIMESTAMP, update_time timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - PRIMARY KEY (id) + PRIMARY KEY (id), + INDEX idx_status (status), + INDEX idx_digest (digest), + INDEX idx_uuid (job_uuid), + INDEX idx_repository_tag (repository,tag) ); create table img_scan_overview ( @@ -298,4 +303,4 @@ CREATE TABLE IF NOT EXISTS `alembic_version` ( `version_num` varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -insert into alembic_version values ('1.4.0'); +insert into alembic_version values ('1.5.0'); diff --git a/make/photon/db/registry_sqlite.sql b/make/photon/db/registry_sqlite.sql index a6e5d8710..c6e4ed2e9 100644 --- a/make/photon/db/registry_sqlite.sql +++ b/make/photon/db/registry_sqlite.sql @@ -290,5 +290,5 @@ create table alembic_version ( version_num varchar(32) NOT NULL ); -insert into alembic_version values ('1.4.0'); +insert into alembic_version values ('1.5.0'); diff --git a/src/common/dao/version.go b/src/common/dao/version.go index 77c61d1de..b2981dc4b 100644 --- a/src/common/dao/version.go +++ b/src/common/dao/version.go @@ -20,7 +20,7 @@ import ( const ( // SchemaVersion is the version of database schema - SchemaVersion = "1.4.0" + SchemaVersion = "1.5.0" ) // GetSchemaVersion return the version of database schema diff --git a/tools/migration/db/changelog.md b/tools/migration/db/changelog.md index 879b549c5..e4614149b 100644 --- a/tools/migration/db/changelog.md +++ b/tools/migration/db/changelog.md @@ -73,3 +73,5 @@ Changelog for harbor database schema - create table `user_group` - modify table `project_member` use `id` as PK and add column `entity_type` to indicate if the member is user or group. - add `job_uuid` column to `replication_job` and `img_scan_job` + - add index `poid_status` in table replication_job + - add index `idx_status`, `idx_status`, `idx_digest`, `idx_repository_tag` in table img_scan_job