This commit is contained in:
2026-04-11 23:30:14 +02:00
parent 10ca8c3e8c
commit b73939d381
1574 changed files with 621 additions and 57974 deletions

30
scratch/check-db.ts Normal file
View File

@@ -0,0 +1,30 @@
import { PrismaClient } from '@prisma/client'
import { config } from 'dotenv'
import path from 'path'
config({ path: path.resolve(process.cwd(), '.env.local') })
const prisma = new PrismaClient()
async function check() {
try {
const users = await prisma.user.count()
console.log(`Users found: ${users}`)
if (users > 0) {
const firstUser = await prisma.user.findFirst()
console.log(`Example user ID: ${firstUser?.id}`)
} else {
console.log("WARNING: User table is EMPTY!")
}
const businesses = await prisma.business.count()
console.log(`Businesses found: ${businesses}`)
} catch (error) {
console.error("Error connecting to DB:", error)
} finally {
await prisma.$disconnect()
}
}
check()