Make things work with or without bundler
Test / test (push) Failing after 55s Details

This commit is contained in:
Jeff 2024-10-02 01:17:02 -04:00
parent b1bbe9a314
commit 3a4d670d04
1 changed files with 5 additions and 1 deletions

View File

@ -2,13 +2,17 @@ import { promises as fs } from "fs"
import { FileMigrationProvider, Migrator } from "kysely"
import * as path from "path"
import { db } from "./database"
import { fileURLToPath } from "url"
let filename = __filename ?? fileURLToPath(import.meta.url)
let dirname = __dirname ?? path.dirname(filename)
const migrator = new Migrator({
db,
provider: new FileMigrationProvider({
fs,
path,
migrationFolder: path.join(__dirname, "migrations"),
migrationFolder: path.join(dirname, "migrations"),
}),
})