From 5c0b980d4dec5fe1510dad0eaa6cf59faf4d4d74 Mon Sep 17 00:00:00 2001 From: skywalker Date: Sat, 9 Nov 2024 14:38:12 +0800 Subject: [PATCH] 12.0.3 sql --- scripts/upgrade/sql/12.0.0/mysql/seahub.sql | 7 +++++-- sql/mysql.sql | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade/sql/12.0.0/mysql/seahub.sql b/scripts/upgrade/sql/12.0.0/mysql/seahub.sql index a905e83bd59..e2436a8859e 100644 --- a/scripts/upgrade/sql/12.0.0/mysql/seahub.sql +++ b/scripts/upgrade/sql/12.0.0/mysql/seahub.sql @@ -43,14 +43,15 @@ CREATE TABLE IF NOT EXISTS `repo_metadata` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `repo_id` VARCHAR(36) NOT NULL, `enabled` TINYINT(1) NOT NULL, + `face_recognition_enabled` TINYINT(1) NULL, + `last_face_cluster_time` DATETIME NULL, `modified_time` DATETIME NOT NULL, `created_time` DATETIME NOT NULL, `from_commit` varchar(40) NULL, `to_commit` varchar(40) NULL, - `face_recognition_enabled` tinyint(1) DEFAULT NULL, - `last_face_cluster_time` datetime DEFAULT NULL, UNIQUE KEY `key_repo_metadata_repo_id`(`repo_id`), KEY `key_repo_metadata_enabled`(`enabled`), + KEY `key_repo_metadata_face_recognition_enabled`(`face_recognition_enabled`), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; @@ -90,5 +91,7 @@ CREATE TABLE IF NOT EXISTS `wiki_wiki2_publish` ( ALTER TABLE share_fileshare ADD COLUMN IF NOT EXISTS `user_scope` varchar(225) DEFAULT 'all_users'; ALTER TABLE share_fileshare ADD COLUMN IF NOT EXISTS `authed_details` LONGTEXT DEFAULT NULL; +ALTER TABLE share_fileshare ADD INDEX IF NOT EXISTS `idx_ctime` (`ctime`); +ALTER TABLE share_fileshare ADD INDEX IF NOT EXISTS `idx_view_cnt` (`view_cnt`); ALTER TABLE profile_profile ADD COLUMN IF NOT EXISTS `is_manually_set_contact_email` tinyint(1) DEFAULT 0; diff --git a/sql/mysql.sql b/sql/mysql.sql index 96bc7be0732..d9c81a89e18 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -955,7 +955,9 @@ CREATE TABLE `share_fileshare` ( KEY `share_fileshare_username_5cb6de75` (`username`), KEY `share_fileshare_repo_id_9b5ae27a` (`repo_id`), KEY `share_fileshare_s_type_724eb6c1` (`s_type`), - KEY `share_fileshare_permission_d12c353f` (`permission`) + KEY `share_fileshare_permission_d12c353f` (`permission`), + KEY `idx_ctime` (`ctime`), + KEY `idx_view_cnt` (`view_cnt`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1534,8 +1536,6 @@ CREATE TABLE `repo_metadata` ( `created_time` DATETIME NOT NULL, `from_commit` varchar(40) NULL, `to_commit` varchar(40) NULL, - `face_recognition_enabled` tinyint(1) DEFAULT NULL, - `last_face_cluster_time` datetime DEFAULT NULL, UNIQUE KEY `key_repo_metadata_repo_id`(`repo_id`), KEY `key_repo_metadata_enabled`(`enabled`), KEY `key_repo_metadata_face_recognition_enabled`(`face_recognition_enabled`),