001project_wildgrowth/backend/scripts/check-watermark.js

18 lines
580 B
JavaScript
Raw Normal View History

2026-02-11 15:26:03 +08:00
#!/usr/bin/env node
require('dotenv').config({ path: require('path').join(__dirname, '../.env') });
const { PrismaClient } = require('@prisma/client');
const p = new PrismaClient();
async function main() {
const c = await p.course.findFirst({
where: { title: { contains: '数据分析' } },
orderBy: { createdAt: 'desc' },
select: { id: true, title: true, watermarkIcon: true, createdAt: true, createdAsDraft: true },
});
console.log(JSON.stringify(c, null, 2));
}
main()
.then(() => p.$disconnect())
.catch((e) => { console.error(e); process.exit(1); });