From 31c81c1f28df91b46cea3e31813b57966e462ea6 Mon Sep 17 00:00:00 2001 From: feiniks <36756310+feiniks@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:45:43 +0800 Subject: [PATCH] Don't create repo_id unique index (#679) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don't create repo_id unique index * Add index when create WebUploadTempFiles --------- Co-authored-by: 杨赫然 --- scripts/sql/mysql/seafile.sql | 3 ++- server/repo-mgr.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/sql/mysql/seafile.sql b/scripts/sql/mysql/seafile.sql index 59fab22..4a630dc 100644 --- a/scripts/sql/mysql/seafile.sql +++ b/scripts/sql/mysql/seafile.sql @@ -324,5 +324,6 @@ CREATE TABLE IF NOT EXISTS WebUploadTempFiles ( id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, repo_id CHAR(40) NOT NULL, file_path TEXT NOT NULL, - tmp_file_path TEXT NOT NULL + tmp_file_path TEXT NOT NULL, + INDEX(repo_id) ) ENGINE=INNODB; diff --git a/server/repo-mgr.c b/server/repo-mgr.c index dd2550a..fb00f89 100644 --- a/server/repo-mgr.c +++ b/server/repo-mgr.c @@ -1095,7 +1095,7 @@ create_tables_mysql (SeafRepoManager *mgr) sql = "CREATE TABLE IF NOT EXISTS WebUploadTempFiles ( " "id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, repo_id CHAR(40) NOT NULL, " - "file_path TEXT NOT NULL, tmp_file_path TEXT NOT NULL, UNIQUE INDEX(repo_id)) ENGINE=INNODB"; + "file_path TEXT NOT NULL, tmp_file_path TEXT NOT NULL, INDEX(repo_id)) ENGINE=INNODB"; if (seaf_db_query (db, sql) < 0) return -1;