This commit is contained in:
Louis Lam 2023-09-04 21:32:48 +08:00
parent ed04008569
commit 9c61247162

View file

@ -46,9 +46,14 @@ class SetupDatabase {
} catch (e) {
log.info("setup-database", "db-config.json is not found or invalid: " + e.message);
// Check if kuma.db is found (1.X.X users)
// Check if kuma.db is found (1.X.X users), generate db-config.json
if (fs.existsSync(path.join(Database.dataDir, "kuma.db"))) {
this.needSetup = false;
log.info("setup-database", "kuma.db is found, generate db-config.json");
Database.writeDBConfig({
type: "sqlite",
});
} else {
this.needSetup = true;
}