-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_users.ts
More file actions
28 lines (22 loc) · 761 Bytes
/
debug_users.ts
File metadata and controls
28 lines (22 loc) · 761 Bytes
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
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function main() {
try {
console.log("Starting debug script...");
const total = await prisma.user.count();
console.log("Total users count:", total);
const users = await prisma.user.findMany({
take: 10,
select: { id: true, email: true, full_name: true }
});
console.log("Users found:", JSON.stringify(users, null, 2));
const wherePaid = { subscription: { some: { status: 'active' } } };
const paidCount = await prisma.user.count({ where: wherePaid });
console.log("Paid users count:", paidCount);
} catch (error) {
console.error("DEBUG ERROR:", error);
} finally {
await prisma.$disconnect();
}
}
main();