Files
iddaai-be/scripts/check_slugs.ts
T
fahricansecer 2f0b85a0c7
Deploy Iddaai Backend / build-and-deploy (push) Failing after 18s
first (part 2: other directories)
2026-04-16 15:11:25 +03:00

24 lines
690 B
TypeScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function checkSlugs() {
console.log("🔍 Checking League Slugs...");
// En çok maçı olan ilk 50 ligin slug'ını getir
const leagues = await prisma.league.findMany({
where: { sport: 'football' },
select: { name: true, competitionSlug: true, _count: { select: { matches: true } } },
orderBy: { matches: { _count: 'desc' } },
take: 50
});
leagues.forEach(l => {
console.log(`Slug: '${l.competitionSlug}' | Name: '${l.name}' | Matches: ${l._count.matches}`);
});
}
checkSlugs()
.catch(e => console.error(e))
.finally(async () => await prisma.$disconnect());