34 lines
639 B
TypeScript
34 lines
639 B
TypeScript
import { PrismaClient } from '@prisma/client'
|
|
|
|
const prisma = new PrismaClient()
|
|
|
|
async function main() {
|
|
const fields = await prisma.uploadField.findMany({
|
|
where: {
|
|
addToCategory: true,
|
|
key: {
|
|
in: ['categoryName', 'sceneName', 'platformName'],
|
|
},
|
|
},
|
|
select: {
|
|
id: true,
|
|
key: true,
|
|
label: true,
|
|
optionsStatic: true,
|
|
},
|
|
})
|
|
|
|
fields.forEach((field) => {
|
|
console.log('---', field.key, field.label)
|
|
console.log(field.optionsStatic)
|
|
})
|
|
}
|
|
|
|
main()
|
|
.catch((error) => {
|
|
console.error(error)
|
|
process.exitCode = 1
|
|
})
|
|
.finally(() => prisma.$disconnect())
|
|
|