generated from fahricansecer/boilerplate-be
+16
-6
@@ -1,9 +1,19 @@
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
const prisma = new PrismaClient();
|
||||
async function main() {
|
||||
const projects = await prisma.project.findMany({ select: { id: true, userId: true, title: true, status: true, deletedAt: true } });
|
||||
console.log('Projects:', projects);
|
||||
const users = await prisma.user.findMany({ select: { id: true, email: true } });
|
||||
console.log('Users:', users);
|
||||
|
||||
async function check() {
|
||||
const analyses = await prisma.youtubeAnalysis.findMany({
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 5
|
||||
});
|
||||
console.log('Recent analyses:');
|
||||
analyses.forEach(a => {
|
||||
console.log(`[${a.createdAt}] ID: ${a.id}, VideoId: ${a.videoId}`);
|
||||
const data = a.analysisData;
|
||||
console.log(` Comment Count saved: ${data.commentCount}`);
|
||||
});
|
||||
}
|
||||
main().catch(console.error).finally(() => prisma.$disconnect());
|
||||
|
||||
check()
|
||||
.catch(console.error)
|
||||
.finally(() => prisma.$disconnect());
|
||||
|
||||
Reference in New Issue
Block a user