From ef1403441e13a31b505b10d180d992e93f6d9223 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 20 Nov 2024 21:22:42 +0300 Subject: [PATCH] Fix migrate script (#560) --- lib/db/migrate.ts | 2 +- lib/db/queries.ts | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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",