Portfolio/Websites/jefes-nextjs/db/migrate.ts
2023-11-30 02:25:32 -08:00

10 lines
349 B
TypeScript

import "dotenv/config";
import { migrate } from "drizzle-orm/mysql2/migrator";
import { db, connection } from "./db";
// This will run migrations on the database, skipping the ones already applied
await migrate(db, { migrationsFolder: "./drizzle" });
// Don't forget to close the connection, otherwise the script will hang
await connection.end();