From 05f890950ed5c9729e4b979bf24e9f46aa59b83f Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 22 Jun 2018 14:32:18 -0300 Subject: [PATCH] seafile-server: Fix SystemInfo table in sqlite db. Added a patch applied upstream. - Fix that table SystemInfo can't be created in sqlite db. Signed-off-by: Eneas U de Queiroz --- ...temInfo-cant-be-created-in-sqlite-db.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch diff --git a/net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch b/net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch new file mode 100644 index 000000000..86a448202 --- /dev/null +++ b/net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch @@ -0,0 +1,32 @@ +From 25dcf165f77c94f758383d35632293d69666d0ad Mon Sep 17 00:00:00 2001 +From: cuihaikuo +Date: Thu, 7 Jun 2018 11:56:44 +0800 +Subject: [PATCH] Fix that table SystemInfo can't be created in sqlite db. + +--- + server/seafile-session.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/server/seafile-session.c b/server/seafile-session.c +index 76d9c12..2a1fc0c 100644 +--- a/server/seafile-session.c ++++ b/server/seafile-session.c +@@ -424,9 +424,17 @@ create_system_default_repo (void *data) + void + schedule_create_system_default_repo (SeafileSession *session) + { +- char *sql = "CREATE TABLE IF NOT EXISTS SystemInfo " ++ int db_type = seaf_db_type (session->db); ++ char *sql; ++ ++ if (db_type == SEAF_DB_TYPE_MYSQL) ++ sql = "CREATE TABLE IF NOT EXISTS SystemInfo " + "(id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, " + "info_key VARCHAR(256), info_value VARCHAR(1024))"; ++ else ++ sql = "CREATE TABLE IF NOT EXISTS SystemInfo( " ++ "info_key VARCHAR(256), info_value VARCHAR(1024))"; ++ + if (seaf_db_query (session->db, sql) < 0) + return; +