flnxi-Wu/scripts/inspect-legacy-categories.ts
WuYongJie d1c6efc79d
Some checks failed
CI Check / check (push) Has been cancelled
feat: NAS 部署与 Harbor 推送流程
2025-12-03 14:39:06 +08:00

29 lines
669 B
TypeScript

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
async function main() {
const [categories, scenes] = await Promise.all([
prisma.category.findMany({ select: { id: true, name: true, options: true } }),
prisma.scene.findMany({ select: { id: true, name: true, options: true } }),
])
console.log('Categories:')
categories.forEach(cat => {
console.log(`- ${cat.name}: ${cat.options}`)
})
console.log('\nScenes:')
scenes.forEach(scene => {
console.log(`- ${scene.name}: ${scene.options}`)
})
}
main()
.catch(err => {
console.error(err)
process.exit(1)
})
.finally(() => prisma.$disconnect())