Browse Source

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 <cote2004-github@yahoo.com>
lilik-openwrt-22.03
Eneas U de Queiroz 6 years ago
parent
commit
05f890950e
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch

+ 32
- 0
net/seafile-server/patches/090-Fix-that-table-SystemInfo-cant-be-created-in-sqlite-db.patch View File

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

Loading…
Cancel
Save