diff --git a/lib/db/migrate.ts b/lib/db/migrate.ts index 73bea87..1280e75 100644 --- a/lib/db/migrate.ts +++ b/lib/db/migrate.ts @@ -18,7 +18,7 @@ const runMigrate = async () => { console.log('⏳ Running migrations...'); const start = Date.now(); - await migrate(db, { migrationsFolder: './lib/drizzle' }); + await migrate(db, { migrationsFolder: './lib/db/migrations' }); const end = Date.now(); console.log('✅ Migrations completed in', end - start, 'ms'); diff --git a/lib/db/queries.ts b/lib/db/queries.ts index 68d27ec..254b981 100644 --- a/lib/db/queries.ts +++ b/lib/db/queries.ts @@ -22,7 +22,7 @@ import { // https://authjs.dev/reference/adapter/drizzle // biome-ignore lint: Forbidden non-null assertion. -const client = postgres(`${process.env.POSTGRES_URL!}?sslmode=require`); +const client = postgres(process.env.POSTGRES_URL!); const db = drizzle(client); export async function getUser(email: string): Promise> { diff --git a/package.json b/package.json index a3c67cf..7f4d9a5 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev --turbo", - "build": "next build", + "build": "tsx lib/db/migrate && next build", "start": "next start", "lint": "next lint && biome lint --write --unsafe", "lint:fix": "next lint --fix && biome lint --write --unsafe",