You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. From 25dcf165f77c94f758383d35632293d69666d0ad Mon Sep 17 00:00:00 2001
  2. From: cuihaikuo <haikuo.cui@seafile.com>
  3. Date: Thu, 7 Jun 2018 11:56:44 +0800
  4. Subject: [PATCH] Fix that table SystemInfo can't be created in sqlite db.
  5. ---
  6. server/seafile-session.c | 10 +++++++++-
  7. 1 file changed, 9 insertions(+), 1 deletion(-)
  8. diff --git a/server/seafile-session.c b/server/seafile-session.c
  9. index 76d9c12..2a1fc0c 100644
  10. --- a/server/seafile-session.c
  11. +++ b/server/seafile-session.c
  12. @@ -424,9 +424,17 @@ create_system_default_repo (void *data)
  13. void
  14. schedule_create_system_default_repo (SeafileSession *session)
  15. {
  16. - char *sql = "CREATE TABLE IF NOT EXISTS SystemInfo "
  17. + int db_type = seaf_db_type (session->db);
  18. + char *sql;
  19. +
  20. + if (db_type == SEAF_DB_TYPE_MYSQL)
  21. + sql = "CREATE TABLE IF NOT EXISTS SystemInfo "
  22. "(id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, "
  23. "info_key VARCHAR(256), info_value VARCHAR(1024))";
  24. + else
  25. + sql = "CREATE TABLE IF NOT EXISTS SystemInfo( "
  26. + "info_key VARCHAR(256), info_value VARCHAR(1024))";
  27. +
  28. if (seaf_db_query (session->db, sql) < 0)
  29. return;