From 90d185dd08539153c60d5c9b549c19aa50a44842 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Tue, 2 Jun 2020 18:43:02 +0200 Subject: [PATCH] M #-: add default sqlite3 database path (#4870) --- src/onedb/onedb.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index 7014352a1c..bf01aa7c84 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -14,6 +14,14 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +ONE_LOCATION = ENV['ONE_LOCATION'] + +if !ONE_LOCATION + SQLITE_PATH = '/var/lib/one/one.db' +else + SQLITE_PATH = ONE_LOCATION + '/var/one.db' +end + require 'onedb_backend' # If set to true, extra verbose time log will be printed for each migrator @@ -33,6 +41,8 @@ class OneDB end if ops[:backend] == :sqlite + ops[:sqlite] = SQLITE_PATH if ops[:sqlite].nil? + begin require 'sqlite3' rescue LoadError