nixpkgs/pkgs/by-name/ho/hoarder/patches/fix-migrations-path.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
574 B
Diff
Raw Normal View History

2025-01-16 13:45:24 +00:00
Without this change the migrations script will fail if the working directory
isn't the same directory this file is located in. To improve usability we
specify the migrations folder relative to __dirname, which doesn't depend on the
working directory.
---
--- a/packages/db/migrate.ts
+++ b/packages/db/migrate.ts
@@ -1,4 +1,5 @@
import { db } from "./drizzle";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
+import path from "path";
-migrate(db, { migrationsFolder: "./drizzle" });
+migrate(db, { migrationsFolder: path.join(__dirname, "./drizzle") });