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