Finished knex_init_db.js

This commit is contained in:
Louis Lam 2023-02-12 03:44:15 +08:00
parent 4056951915
commit f2633a5d01
2 changed files with 153 additions and 8 deletions

View file

@ -160,6 +160,8 @@ class Database {
let config = {};
log.info("db", `Database Type: ${dbConfig.type}`);
if (dbConfig.type === "sqlite") {
if (! fs.existsSync(Database.sqlitePath)) {
@ -273,7 +275,7 @@ class Database {
let hasTable = await R.hasTable("docker_host");
if (!hasTable) {
const { createTables } = require("../db/kuma");
const { createTables } = require("../db/knex_init_db");
await createTables();
} else {
log.debug("db", "MariaDB database already exists");