mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-24 03:05:43 +02:00
- Remove unused SQLite migration script 1.8.1.ts that was causing TypeScript compilation errors during PostgreSQL builds - Fix verifyTotp.ts type error by adding proper null check for password parameter before passing to verifyPassword function - Fix SQLite migration script 1.7.0.ts syntax errors in transaction structure and error handling **- Update SQLite migration system to not drop tables by default, as this was used during testing and should not be in production.** Fixes build failures for both "make build" (SQLite) and "make build-pg" (PostgreSQL) Docker image builds.
20 lines
547 B
TypeScript
20 lines
547 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();
|