diff --git a/api/migrations/config.cjs b/api/migrations/config.cjs index b4f5067d..9df46d7b 100644 --- a/api/migrations/config.cjs +++ b/api/migrations/config.cjs @@ -1,21 +1,16 @@ const { join } = require("node:path"); -const config = require("../utils/config.cjs"); +const { dbConfig, logLevel, production } = require("../utils/config.cjs"); const migrationConfig = { "ignore-pattern": "(config|template)\\.cjs$", "migrations-dir": __dirname, "template-file-name": join(__dirname, "template.cjs"), - url: config.dbConfig, + url: dbConfig, }; -if ( - /* eslint-disable no-restricted-syntax */ - process.env.NODE_ENV?.toLowerCase() !== "production" && - process.env.LOG_LEVEL?.toLowerCase() === "debug" - /* eslint-enable no-restricted-syntax */ -) { - /* eslint-disable-next-line no-console */ +if (logLevel === "debug" && !production) { + /* eslint-disable-next-line no-console -- app logger not available here */ console.debug("migrating with %O", migrationConfig); }