error with neon and drizzle
migrate.ts
import { drizzle } from "drizzle-orm/neon-http";
import {migrate } from "drizzle-orm/neon-http/migrator";
import { neon } from "@neondatabase/serverless";
const sql = neon (process.env.DATABASE_URL as string);
const db = drizzle(sql);
const main= async () => {
try {
await migrate(db,{
migrationsFolder:"./migrations",
});
console.log("success!")
} catch (error) {
console.log(error)
}
}
main();
migrate.ts
import { drizzle } from "drizzle-orm/neon-http";
import {migrate } from "drizzle-orm/neon-http/migrator";
import { neon } from "@neondatabase/serverless";
const sql = neon (process.env.DATABASE_URL as string);
const db = drizzle(sql);
const main= async () => {
try {
await migrate(db,{
migrationsFolder:"./migrations",
});
console.log("success!")
} catch (error) {
console.log(error)
}
}
main();
0 Replies