summaryrefslogtreecommitdiff
path: root/src/accretion.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/accretion.mjs')
-rw-r--r--src/accretion.mjs6
1 files changed, 3 insertions, 3 deletions
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);