mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
15 lines
484 B
TypeScript
15 lines
484 B
TypeScript
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
|||
|
|
import { db } from "./index.js";
|
||
|
|
import { fileURLToPath } from "node:url";
|
||
|
|
import { dirname, join } from "node:path";
|
||
|
|
|
||
|
|
const __filename = fileURLToPath(import.meta.url);
|
||
|
|
const __dirname = dirname(__filename);
|
||
|
|
|
||
|
|
// Resolve migrations folder relative to this file, not the working directory
|
||
|
|
const migrationsFolder = join(__dirname, "../../drizzle");
|
||
|
|
|
||
|
|
export function runMigrations() {
|
||
|
|
migrate(db, { migrationsFolder });
|
||
|
|
}
|