22 lines
389 B
TypeScript
22 lines
389 B
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
await prisma.product.updateMany({
|
|
data: {
|
|
price: null,
|
|
},
|
|
});
|
|
console.log('Successfully set all Product prices to null');
|
|
}
|
|
|
|
main()
|
|
.catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
})
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|