From 458bf0fc628d9bcf6a59a0efb898045266dab6ba Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 25 Feb 2024 05:01:00 -0300 Subject: Explicit import from "node:process"; move log() to hero.mjs --- src/accretion.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/accretion.mjs') diff --git a/src/accretion.mjs b/src/accretion.mjs index a9adb97..1c70162 100644 --- a/src/accretion.mjs +++ b/src/accretion.mjs @@ -9,9 +9,9 @@ import * as u from "./utils.mjs"; const DIRNAME = path.dirname(url.fileURLToPath(import.meta.url)); -const MIGRATIONS_DIR = DIRNAME + "/sql/migrations/"; +export const MIGRATIONS_DIR = DIRNAME + "/sql/migrations/"; -export const runMigrations = async db => { +export const runMigrations = async (logFn, db) => { assert(db); await db.exec(` @@ -30,7 +30,7 @@ export const runMigrations = async db => { .sort((a, b) => a.localeCompare(b, "POSIX")); for (const filename of sortedPending) { - u.log({ log: "exec-migration", filename }); + logFn({ log: "exec-migration", filename }); const sql = fs.readFileSync(MIGRATIONS_DIR + filename, "UTF-8"); await db.exec("BEGIN TRANSACTION;"); await db.exec(sql); -- cgit v1.2.3