Something went wrong. Try again.
a Page to view some global statistics about Modrinth modrinth-statistics.tobinio.dev
Something went wrong. Try again.
544 B · 19 lines
TypeScript
at main
1234567891011121314151617181920import { join } from "node:path";import { migrate } from "drizzle-orm/node-postgres/migrator";
export default defineNitroPlugin(async () => { const noDbWrite = useRuntimeConfig().noDbWrite; if (noDbWrite) { LOGGER.warn("noDbWrite is enabled - not running database migration"); return; }
LOGGER.info("Running database migration"); const db = useDrizzle(); await migrate(db, { migrationsFolder: join(process.cwd(), "./server/database/migrations"), }); LOGGER.info("Database migration completed");
await runTask("analyze");});