seafile-server: Fix SystemInfo table in sqlite db.
authorEneas U de Queiroz <redacted>
Fri, 22 Jun 2018 17:32:18 +0000 (14:32 -0300)
committerEneas U de Queiroz <redacted>
Fri, 22 Jun 2018 17:32:18 +0000 (14:32 -0300)
Added a patch applied upstream.
 - Fix that table SystemInfo can't be created in sqlite db.

Signed-off-by: Eneas U de Queiroz <redacted>
net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch [new file with mode: 0644]

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 (file)
index 0000000..86a4482
--- /dev/null
@@ -0,0 +1,32 @@
+From 25dcf165f77c94f758383d35632293d69666d0ad Mon Sep 17 00:00:00 2001
+From: cuihaikuo <haikuo.cui@seafile.com>
+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;
git clone https://git.99rst.org/PROJECT