mirror of
https://github.com/fosrl/pangolin.git
synced 2025-06-20 20:35:43 +02:00
20 lines
543 B
TypeScript
20 lines
543 B
TypeScript
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
|
import db from "./driver";
|
|
import path from "path";
|
|
|
|
const migrationsFolder = path.join("server/migrations");
|
|
|
|
const runMigrations = async () => {
|
|
console.log("Running migrations...");
|
|
try {
|
|
migrate(db as any, {
|
|
migrationsFolder: migrationsFolder,
|
|
});
|
|
console.log("Migrations completed successfully.");
|
|
} catch (error) {
|
|
console.error("Error running migrations:", error);
|
|
process.exit(1);
|
|
}
|
|
};
|
|
|
|
runMigrations();
|