mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-13 13:50:40 +01:00
18 lines
505 B
TypeScript
18 lines
505 B
TypeScript
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
|
import db from "@server/db";
|
|
import path from "path";
|
|
|
|
const runMigrations = async () => {
|
|
console.log("Running migrations...");
|
|
try {
|
|
migrate(db, {
|
|
migrationsFolder: path.join(__dirname, "server/migrations"),
|
|
});
|
|
console.log("Migrations completed successfully.");
|
|
} catch (error) {
|
|
console.error("Error running migrations:", error);
|
|
process.exit(1);
|
|
}
|
|
};
|
|
|
|
runMigrations();
|