Files
Content-Hunter_BE/test-script2.ts
Harun CAN dee6e29cfd
Some checks failed
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled
main
2026-03-14 14:01:01 +03:00

20 lines
588 B
TypeScript

import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const masters = await prisma.masterContent.findMany({
orderBy: { createdAt: 'desc' },
take: 10,
include: { contents: true }
});
for (const master of masters) {
console.log(`Master: ${master.id}, Topic: ${master.title}`);
for (const c of master.contents) {
console.log(` - ${c.type} -> title: ${c.title}`);
}
}
}
main()
.catch(console.error)
.finally(async () => { await prisma.$disconnect(); });