mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-13 15:35:00 +02:00
add different driver
This commit is contained in:
parent
a512148348
commit
1e55d96376
6 changed files with 338 additions and 280 deletions
20
server/db/migratePostgres.ts
Normal file
20
server/db/migratePostgres.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { migrate } from "drizzle-orm/node-postgres/migrator";
|
||||
import db from "@server/db";
|
||||
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();
|
Loading…
Add table
Add a link
Reference in a new issue