Skip to content

Commit

Permalink
Don't create repo_id unique index (#679)
Browse files Browse the repository at this point in the history
* Don't create repo_id unique index

* Add index when create WebUploadTempFiles

---------

Co-authored-by: 杨赫然 <[email protected]>
  • Loading branch information
feiniks and 杨赫然 authored Aug 9, 2024
1 parent 9930112 commit 31c81c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/sql/mysql/seafile.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion server/repo-mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 31c81c1

Please sign in to comment.