Don't create repo_id unique index (#679)

* Don't create repo_id unique index

* Add index when create WebUploadTempFiles

---------

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
feiniks 2024-08-09 17:45:43 +08:00 committed by GitHub
parent 9930112249
commit 31c81c1f28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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;