-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-data.js
More file actions
37 lines (30 loc) · 1.08 KB
/
Copy pathcheck-data.js
File metadata and controls
37 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()
async function checkData() {
try {
console.log('=== CHECKING DATABASE DATA ===')
// Check Posts
const posts = await prisma.post.findMany()
console.log(`\n📝 POSTS: ${posts.length} found`)
posts.forEach(post => {
console.log(` - "${post.content.substring(0, 50)}..." by ${post.authorId}`)
})
// Check Testimonials
const testimonials = await prisma.testimonial.findMany()
console.log(`\n💬 TESTIMONIALS: ${testimonials.length} found`)
testimonials.forEach(testimonial => {
console.log(` - "${testimonial.content.substring(0, 50)}..." by ${testimonial.authorId}`)
})
// Check Users
const users = await prisma.user.findMany()
console.log(`\n👥 USERS: ${users.length} found`)
users.forEach(user => {
console.log(` - ${user.firstName} ${user.lastName} (${user.email})`)
})
} catch (error) {
console.error('❌ Error checking data:', error)
} finally {
await prisma.$disconnect()
}
}
checkData()