never set db version to 0. related to #80

There is no need to initially set the database version to 0, returning 0
is enough to run the appropriate migrations.

This will partially fix #80. The underlying problem is probably a
temporary database lock that causes an exception in getOpt(). This still
needs to be addressed.
This commit is contained in:
Andreas Gohr
2023-07-22 19:16:15 +02:00
parent fd7ab75f00
commit fe64ba38fa

View File

@ -30,6 +30,8 @@ class SQLiteDB
/** @var \helper_plugin_sqlite */
protected $helper;
/**
* Constructor
*
@ -452,7 +454,6 @@ class SQLiteDB
// add the opt table - if this fails too, let the exception bubble up
$sql = "CREATE TABLE IF NOT EXISTS opts (opt TEXT NOT NULL PRIMARY KEY, val NOT NULL DEFAULT '')";
$this->exec($sql);
$this->setOpt('dbversion', 0);
return 0;
}
}